Good morning,
Since I successfully migrated my Pi4 node to a VM hosted on a NUC, and since it’s hard to find an end2end guide to proceed, below are the steps I followed.
My goal was to run my Bitcoin node and my LND node on my new infrastructure, without losing any data (in particular, keeping my channels opened).
Disclaimers:
- this guide suits for Migration, not for Disaster Recovering (restoring node). In case you lost access to your node, you may want to follow this guide
- if you can, perform some test before on VM, in order to repeat the procedure and ensure everything is fine.
- LND should never run on the current and the future node at the same time
- For copying data from one node to another, you should use Rsync command instead of Scp (otherwise you will get rights issues when running applications
This guide is split up in 2 phases: Bitcoin migration and LND migration.
Bitcoin migration (from Node1 to Node2):
- stop all services on Node1
- start to download Bitcoin blockchain on Node2
- When 1% is reached, stop Bitcoin application on Node2
- Go to Node2 via Putty, cd to directory umbrel/app-data/bitcoin/data/bitcoin and delete the 3 folders : Blocks, Chainstate, Indexes.
- Go to Node1 via Putty, cd to directory umbrel/app-data/bitcoin/data/bitcoin and use Rsync command to copy the local directories (Blocks, Chainstate, Indexes) to remote Node2 ; for instance i used :
sudo sshpass -p “XXXXX” rsync -e ssh -a ./blocks umbrel@AAAAA:~/umbrel/app-data/bitcoin/data/bitcoin &
- Wait until directories are copied. It took me around 4 hours.
- On Node2 web interface, start Bitcoin service. It should be around 99% and should be finishing syncing.
LND migration:
- Verify that Node1 services are stopped, especially Lightning Network
- Go to Node2, download Lightning Network app. When done, start it and then the stop it.
- Connect to Node2 via Putty, and delete the directory umbrel/app-data/lightning/data/lnd/data
- Connect to Node1, copy the local directory umbrel/app-data/lightning/data/lnd/data to Node2, using Rsync as previously, at the location umbrel/app-data/lightning/data/lnd/
- It takes 3 minutes to copy the directory
- On Node2 web interface, start Lightning Network service.
- it took me 30 minutes for seeing my LN Node as before, but i got back all my sats and all my channels
- Never try to run LND on Node1 and Node2 in the same time
Again, i recommend to perform some tests on empty nodes before doing the migration on your “production node”.
I hope this will help some of you.