Validators
Testnet
Maintenance
Migrating to a Different Server

Migrating to a Different Server

No problem, one of your amazing community members has developed this guide. After you have created a new machine and finished all the steps up to and including Creating new linux users, follow this guide.

Do not perform migration steps during a rotation.

Backup Your Engine Database from the Old Server

The engine database contains the threshold signing keyshares of your validator. Thus, you should backup this database before you start the migration process, and ensure you keep it stored safely and securely.

/etc/chainflip/data.db is the default location. If you have changed the location, please adjust the path accordingly. The path the engine uses for it's database is specified in the Engine Settings section.

# Optional
# [signing]
# db_path = "/etc/chainflip/data.db"
# Run these commands on your old server
sudo systemctl stop chainflip-engine
 
cp /etc/chainflip/data.db /etc/chainflip/data.db.backup
# Restart the engine on your old server while setting up the new one
sudo systemctl start chainflip-engine

Transfer Database Backup to Your New Server

You'll need to transfer the database backup from your old server to the new one. Use the scp command from your new server to securely copy the file:

# Run these commands on your new server
mkdir -p /etc/chainflip/
 
# Run this command on your new server
# Replace OLD_SERVER_IP with your old server's IP address
# Replace username with your username on the old server
scp username@OLD_SERVER_IP:/etc/chainflip/data.db.backup /etc/chainflip/
 
# Rename the file to data.db
mv /etc/chainflip/data.db.backup /etc/chainflip/data.db

You may need to use sudo to place the file in the destination directory and/or create the directory, or alternatively copy it to your home directory first and then move it with sudo.

On Your New Machine

Download Binaries via APT Repo

gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys BDBC3CF58F623694CD9E3F5CFB3E88547C6B47C6

Verify the key's authenticity

gpg --export BDBC3CF58F623694CD9E3F5CFB3E88547C6B47C6 | gpg --show-keys

Important: Make sure you see the following output from the terminal:

pub   rsa3072/0xFB3E88547C6B47C6 2022-11-08 [SC]
    Key fingerprint = BDBC 3CF5 8F62 3694 CD9E  3F5C FB3E 8854 7C6B 47C6
uid                              Chainflip Labs GmbH <dev@chainflip.io>
sub   rsa3072/0x48249A1599E31935 2022-11-08 [E]

Add Chainflip's Repo to apt sources list

gpg --export BDBC3CF58F623694CD9E3F5CFB3E88547C6B47C6 | sudo tee /etc/apt/trusted.gpg.d/chainflip-perseverance.gpg
echo "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/chainflip-perseverance.gpg] https://repo.chainflip.io/perseverance/jammy jammy main" | sudo tee /etc/apt/sources.list.d/chainflip.list

Installing The Packages

sudo apt-get update
sudo apt-get install -y chainflip-cli chainflip-node chainflip-engine

Adding your existing keys

sudo mkdir /etc/chainflip/keys

Note: After this you don't need to generate new Signing Keys, you can skip that phase and continue to the command below with your old Seed Secret.

Recovering Your Keys

THE_OLD_PHRASE << change to your old phrase you have backed up.

chainflip-cli generate-keys \
    --path /etc/chainflip/keys \
    --seed-phrase 'THE_OLD_PHRASE'

Please note that the Node Key cannot be recovered, a new one will be generated. This will result in a new peer id for your node.

Back Them Up & Copy Your Validator ID

sudo chmod 600 /etc/chainflip/keys/ethereum_key_file
sudo chmod 600 /etc/chainflip/keys/signing_key_file
sudo chmod 600 /etc/chainflip/keys/node_key_file
history -c

Make sure to update your config file with the IP address of the new VPS. Otherwise you'll get slashed once you start the engine on the new VPS.

Do not run two instances of your Validator at the same time. You will almost certainly be slashed. Make sure you turn off your old server before you turn on your new one.

After that make sure to stop the engine and the node on the old VPS by running:

On the Old VPS

sudo systemctl disable --now chainflip-node.service
sudo systemctl disable --now chainflip-engine.service
sudo apt purge chainflip-node
sudo apt purge chainflip-engine

On the New VPS

  1. Setup the config file as explained in Engine Settings section.
  2. Then start the node and engine services as explained in Start up section.