How do I migrate my node to a new device?

To migrate your Node to a new drive or computer, you first need to copy both the contents of your storage folder, as well as your identity folder to the new location.

Your default identity folder is located in: %APPDATA%\Storj\Identity\storagenode

Your default orders folder is located in "%ProgramFiles%\Storj\Storage Node\orders"

To migrate your Windows storage node you can follow this guide: How to migrate the Windows GUI node from one physical location to another? The only difference - you do not need to share folders, since they are available locally, just use the local paths.

Also, you can enable WSL, install Ubuntu from the Microsoft store and use the How do I migrate my node to a new device? guide. In this case your drives are mounted automatically. For example, D: disk will be mounted to the /mnt/d.

Migrating with rsync

We will assume that your parameters look like this:

  • the source folder where the existing identity is located is /mnt/storj/identity/storagenode;

  • the source folder where the existing stored data is located is /mnt/storj/storagenode/storage;

  • the source folder where the existing orders folder is located is /mnt/storj/storagenode/orders;

  • the destination folder the existing identity will be copied to is/mnt/storj2/storagenode-new/identity;

  • the destination folder the existing stored data will be copied to is /mnt/storj2/storagenode-new/storage.

  • the destination folder the existing orders will be copied to is /mnt/storj2/storagenode-new/orders.

To migrate your identity, orders and data to the new location, you can use the rsync command (please, replace the example paths mentioned above to your own!):

  1. Open a new terminal

  2. Keep your original storage node running

  3. Copy the identity:

rsync -aP /mnt/storj/identity/storagenode/ /mnt/storj2/storagenode-new/identity/
rsync -aP /mnt/storj/identity/storagenode/ /mnt/storj2/storagenode-new/identity/

4. Copy the orders

rsync -aP /mnt/storj/storagenode/orders/ /mnt/storj2/storagenode-new/orders/
rsync -aP /mnt/storj/storagenode/orders/ /mnt/storj2/storagenode-new/orders/

5. Copy the data

rsync -aP /mnt/storj/storagenode/storage/ /mnt/storj2/storagenode-new/storage/
rsync -aP /mnt/storj/storagenode/storage/ /mnt/storj2/storagenode-new/storage/

6. Repeat running the orders (step 4.) and data copying command (step 5.) a few more times until the difference would be negligible, then

7. Stop the storage node (see How do I shut down my node for system maintenance? )

8. Remove the old container

docker rm storagenode
docker rm storagenode

9. Run the copying command with a --delete parameter to remove deleted files from the destination:

rsync -aP --delete /mnt/storj/storagenode/orders/ /mnt/storj2/storagenode-new/orders/
rsync -aP --delete /mnt/storj/storagenode/orders/ /mnt/storj2/storagenode-new/orders/
rsync -aP --delete /mnt/storj/storagenode/storage/ /mnt/storj2/storagenode-new/storage/
rsync -aP --delete /mnt/storj/storagenode/storage/ /mnt/storj2/storagenode-new/storage/

10. Now you can copy config.yaml file and revocation.db to the new location:

cp /mnt/storj/storagenode/config.yaml /mnt/storj2/storagenode-new/
cp /mnt/storj/storagenode/revocation.db /mnt/storj2/storagenode-new/revocation.db
cp /mnt/storj/storagenode/config.yaml /mnt/storj2/storagenode-new/
cp /mnt/storj/storagenode/revocation.db /mnt/storj2/storagenode-new/revocation.db

11. After you copied over all the necessary files, update your --mount parameters in yourStorage Node. For our example, it will look like this (we only show a partial example of the new--mount parameter lines, not the entire docker run command!):

--mount type=bind,source=/mnt/storj2/storagenode-new/identity,destination=/app/identity \
--mount type=bind,source=/mnt/storj2/storagenode-new,destination=/app/config \
--mount type=bind,source=/mnt/storj2/storagenode-new/identity,destination=/app/identity \
--mount type=bind,source=/mnt/storj2/storagenode-new,destination=/app/config \

The network-attached storage location could work, but it is neither supported nor recommended!

Please, note - we intentionally specified/mnt/storj2/storagenode-new as the data source in the --mount parameter and not /mnt/storj2/storagenode-new/storage because the storagenode docker container will add a subfolder called storage to the path automatically. So please, make sure that your data folder contains a storage subfolder with all the data inside (blobs folder, database files, etc.), otherwise the node will start from scratch since it can't find the data in the right subfolder and will be disqualified in a few hours.

If you migrating across platforms (x86-64 -> x86-32, x86 -> ARM, etc.), please remove binaries from the bin subfolder in the storage location to allow the container to download binaries for your new platform.

Related to these changes: https://github.com/storj/storagenode-docker/issues/23

Previous
How do I know the exchange rate for my payout?