Open kn0wmad opened 9 months ago
Here's how I migrated a CLN node from my Raspiblitz to StartOS, keeping the channels alive:
On StartOS, set up SSH key for the root user:
# Switch to root
sudo su -
# Generate key
ssh-keygen -t ed25519 -C "root@startOS"
# Add the key to the SSH agent
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
# Show the public key
cat /root/.ssh/id_ed25519.pub
Copy the public key and switch to the Raspiblitz:
# Add StartOS public key to root's authorized_keys - edit the file and insert the copied key
sudo vim /root/.ssh/authorized_keys
# Stop Core Lightning on Raspiblitz
./config.scripts/cl.install.sh off
The last step, stopping Core Lightning on Raspiblitz, is very important. Ensure it is stopped using sudo systemctl status lightningd.service
!
Before migrating, I brought up a fresh install of CLN on StartOS, so that I knew where to copy stuff. Not sure if this is necessary, but I did it like this to ensure the directories are setup correctly and I'd advise you to do the same.
Once CLN starts up correctly, stop it on StartOS as well.
/mnt/hdd/app-data/.lightning/bitcoin/
/embassy-data/package-data/volumes/c-lightning/data/main/bitcoin/
On StartOS CLI:
# Switch to root
sudo su -
# Enter the CLN main directory
cd /embassy-data/package-data/volumes/c-lightning/data/main/
# Just in case, backup the original files
cp -r bitcoin bitcoin-backup-original
# copy files over
scp -r root@YOUR_RASPIBLITZ_IP:/mnt/hdd/app-data/.lightning/bitcoin/* bitcoin
You might not need to copy all the files, these are the ones you'll want at least though:
accounts.sqlite3
emergency.recover
gossip_store
hsm_secret
lightningd.sqlite3
keys.clboss
(in case you've used clboss on Raspiblitz)You might want to also adapt the config file to fit what you had before on Raspiblitz. Compare these files and adjust them, e.g. by replacing the StartOS alias with the one you had on Raspiblitz:
/mnt/hdd/app-data/.lightning/config
/embassy-data/package-data/volumes/c-lightning/data/main/config
Afterwards I simply restarted CLN on StartOS and kept an eye on the Core Lightning Service Logs.
https://docs.corelightning.org/docs/recovery