Migrate one Oraichain node to another
You should back up all the node information before migrating to recover if something goes wrong. The two files you want to copy is: .oraid/config/priv_validator_key.json and .oraid/config/node_key.json
To start migrating, you can create a new node to initialize all the configuration files needed. For more information relating to creating a new node, you can follow the full node operator creation tutorial here. You can use the same moniker as the current node's
Your newly created node should synchronize with the network before migrating to reduce the downtime
You can edit freely while keeping your new node running.
enter your node by:
docker-compose exec orai bash
shut down your node by:
docker-compose restart orai && docker-compose exec -d orai bash -c 'oraivisor start --p2p.pex false --p2p.persistent_peers "<node-id1>@<private-ip1>:26656,<node-id2>@<private-ip2>:26656"'
enter the container and type:
oraid status && oraid tendermint show-node-id
if the voting power matches the node you have just migrated from, and the node id matches the current node, then congratuations, you have finished the migration process. If not, don't worry. Please check if you have copied everything right and restart again. A common mistake is to not stop the current node before restarting the new node. Another common mistake is to copy the files to the new node before syncing, as it may cause your new node unable to sync. It is because other nodes will reject connections coming from the same node id that they have been persistently connecting to.
Your current node will not be affected during the process. If you want, you can always stop the new node and then start the current node again without any interruptions.
You can import your wallet to the new node after the migration process has finished. Type:
oraid keys add <wallet name> --recover
Or you can just use the explorer for simplicity.