WARNING: After completing this migration do not ever restart your RaspiBlitz. Doing so can result in the broadcast of old channel states and loss of funds.
This guide details the process to migrate LND (and optionally bitcoin) from a RaspiBlitz to a server running StartOS using the same hardware. The commands in this guide assume Linux based operating system is used but the same commands should work for Mac as well.
Note: This guide is only necessary to transfer LND data if you are repurposing the RaspiBlitz hardware; If you have separate hardware, you can transfer LND with a simple action: Import from RaspiBlitz
available in LND on your server running StartOS.
- Make a directory on your local machine for temporarily storing the data to be migrated i.e.
mkdir /Users/start9/raspiblitz
- Find the hostname of your RaspiBlitz (check your router DHCP leases if you are unsure) and ssh into your RaspiBlitz:
ssh admin@<IP_ADDRESS>
#Where <IP_ADDRESS> is the IP address of your RaspiBlitz.
#You will be prompted for your RaspiBlitz SSH password (Password A)
- Stop LND
lncli stop
To confirm LND has been stopped on your RaspiBlitz after running the above command, you should see an error similar to the below on your RaspiBlitz dashboard.
- Outside of your RaspiBlitz SSH session, run the below command to copy your RaspiBlitz LND data to your local machine. Be sure to replace
~/raspiblitz
with name of your directory created in step 1. Don’t forget to append/data
to the end of this filepath!
rsync -vr --rsync-path="sudo rsync" admin@<IP_ADDRESS>:/mnt/hdd/lnd/data/ ~/raspiblitz/data/
#Note: the above command will prompt you for your ssh password (RaspiBlitz Password A).
- Optional - If desired and you have the space on your mac/linux machine (~550GB as of mid 2023) you can avoid another IBD by copying your RaspiBlitz blockchain with the command below. This command may take a while to run as it is copying the entire bitcoin blockchain. Be sure to include
/bitcoin/
at the end of your path.
rsync -vr --rsync-path="sudo rsync" admin@<IP_ADDRESS>:/mnt/hdd/bitcoin{blocks,chainstate} ~/raspiblitz/bitcoin/
#Note: the above command will prompt you for your ssh password (RaspiBlitz Password A).
-
Once the above steps have been completed, you can flash StartOS and proceed with initial setup.
-
After initial setup, you will need to setup ssh.
-
Install the LND service on your new StartOS server but DO NOT start LND yet!
-
Optional - if you are copying the bitcoin blockchain:
# IMPORTANT: In the next line, replace ADJECTIVE-NOUN.local with your Start9 server's hostname
rsync --rsync-path="sudo mkdir -p /embassy-data/package-data/volumes/bitcoind/data/main ; sudo rsync" ~/raspiblitz/bitcoin/{blocks,chainstate} start9@ADJECTIVE-NOUN.local:/embassy-data/package-data/volumes/bitcoind/data/main/
- Copy LND data; as before, be sure to edit the hostname.
# IMPORTANT: In the next line, replace `ADJECTIVE-NOUN.local` with your Start9 server's hostname
rsync -vr --rsync-path="sudo mkdir -p /embassy-data/package-data/volumes/lnd/data/main/data ; sudo rsync" ~/raspiblitz/data/ start9@ADJECTIVE-NOUN.local:/embassy-data/package-data/volumes/lnd/data/main/data/
- SSH into your Start9 server and and insert your RaspiBlitz lncli password (Password C) into pwd.dat
ssh start9@ADJECTIVE-NOUN.local
sudo -i
echo -n '<raspiblitz_password_c>' > /embassy-data/package-data/volumes/lnd/data/main/pwd.dat
#Replace <raspiblitz_password_c> with Password C from your RaspiBlitz.
- After confirming LND (and optionally bitcoin) have been successfully copied to your new startOS server, you can delete your local copy of the blockchain and LND data by running the below command on your mac/linux machine.
rm -rf ~/raspiblitz