Comment on page
How to migrate an XDC Node
This guide will walk you through migrating you current XDC standby/masternode from a local machine or cloud provider to another cloud provider.
You will need the following to be able to migrate you current XDC node:
- The coinbase address from your current node
- The keystore file (file name starts with UTC--)
- SCP tool if using Windows (already built in to terminal if using a Mac)
- Login information for destination cloud provider (IP address and user for that terminal, normally admin, root, or ubuntu).
If you manage your node, log in, navigate to your coinbase.txt file, and copy the XDC address inside it. You can use either Nano or Vi. For the purpose of this guide and the tool's simplicity, we will be using Nano.
Note: If your node is being managed by a third party, please get in touch with them for items 1 and 2 above as these two are needed for the following steps.
Log in to your new server where you are migrating your old XDC node to and navigate to:
Bring down your node
sudo docker-compose -f docker-compose.yml down
Paste the command below, you should still be in the "XinFin-Node/mainnet" directory. The command below will open the coinbase.txt file.
Replace the address in the coinbase.txt file with the one from your old node or the one received from your cloud provider. Save and exit the nano tool.
Next, we are going to replace the UTC-- file inside the keystore directory. Absolute path:
On your local machine, open the terminal (Mac users) or cmd prompt (if using Windows).
To securely copy (scp) files from a local Mac machine to a remote Ubuntu server, you first need to ensure that you have SSH access to your Ubuntu server.
Once you have SSH access, you can use the scp command from the terminal on your Mac. Here is a general format for the scp command:
scp /path/to/local/file username@remote-IP:/path/to/remote/directory
/path/to/local/file: Replace this with the path to the file on your local machine that you want to copy.
username: Replace this with your username on the remote Linux server.
remote-IP: Replace this with the IP address of the remote Linux server.
/path/to/remote/directory: Replace this with the path on the remote Linux server where you want to copy the file.
For example, if you want to copy a file named "example.txt" from your Desktop to the home directory of your user account (named "myusername") on a remote server with the IP address "192.168.1.1", you would use this command:
Remember to replace "myusername" and "192.168.1.1" with your actual username and the IP address of your remote server.
After entering this command, you'll be prompted to enter your password for the remote Ubuntu server. After entering the password, the file will be copied.
Note: You may also need to specify the port number if your SSH server is listening on a non-default port. You can do this by adding
-P portafter the scp command. For example:
Remove the old UTC file in the keystore directory
Bring back node back up
sudo docker-compose -f docker-compose.yml up -d
Check the logs to ensure that everything is working as intended.