... | ... | @@ -131,24 +131,49 @@ procedure](#installation) and has an up to date blockchain. |
|
|
On server A:
|
|
|
|
|
|
systemctl stop btcpayserver
|
|
|
tar -c -z --exclude generated_bitcoin_datadir -f backup.tgz /var/lib/docker/volumes/
|
|
|
|
|
|
Note that this excludes the blockchain, to save some space. It's
|
|
|
assumed the target already has a copy.
|
|
|
tar -c -z -f backup.tgz /var/lib/docker/volumes/
|
|
|
|
|
|
Copy `backup.tgz` to server B.
|
|
|
|
|
|
On server B:
|
|
|
|
|
|
systemctl stop btcpayserver
|
|
|
mv /var/lib/docker/volumes/generated_bitcoin_datadir/ /var/lib/docker/generated_bitcoin_datadir.bak/
|
|
|
rm -rf /var/lib/docker/volumes/
|
|
|
tar -C / -x -f -z backup.tgz
|
|
|
mv /var/lib/docker/generated_bitcoin_datadir.bak/ /var/lib/docker/volumes/generated_bitcoin_datadir/
|
|
|
/root/BTCPayServer/btcpayserver-docker/changedomain.sh btcpay.torproject.org
|
|
|
systemctl start btcpayserver
|
|
|
|
|
|
Make sure to update the target of the donation form on
|
|
|
Note that this is likely to run out of disk space because it
|
|
|
(deliberately) includes the blockchain.
|
|
|
|
|
|
Another option is to stream the content between the two servers, if
|
|
|
you have a fast link:
|
|
|
|
|
|
ssh old.example.net 'systemctl stop btcpayserver'
|
|
|
ssh new.example.net 'systemctl stop btcpayserver'
|
|
|
ssh old.example.net 'tar cf - /var/lib/docker/volumes/' | pv -s 49G | ssh new.example.net tar -C / -x -f -
|
|
|
ssh new.example.net 'systemctl start btcpayserver'
|
|
|
|
|
|
Or, alternatively, you can also create an SSH key on the new server,
|
|
|
copy it on the old one, and just use `rsync`, which is what ended up
|
|
|
being used in the [actual migration](https://gitlab.torproject.org/tpo/tpa/team/-/issues/33750):
|
|
|
|
|
|
ssh old.example.net 'systemctl stop btcpayserver'
|
|
|
ssh new.example.net 'systemctl stop btcpayserver'
|
|
|
ssh new.example.net 'ssh-keygen -t ed25519'
|
|
|
ssh new.example.net 'cat .ssh/id_ed25519.pub' | ssh old.example.net 'cat >> .ssh/authorized_keys'
|
|
|
ssh new.example.net 'rsync -a --info=progress2 --delete old.example.net:/var/lib/docker/volumes/ /var/lib/docker/volumes/'
|
|
|
|
|
|
It's important that the Docker volumes are synchronized: for example,
|
|
|
if the NBXplorer volume is ahead or behind the bitcoind volume, it
|
|
|
will get confused and will not be able to synchronize with the
|
|
|
blockchain. This is why we copy the full blockchain which, anyways, is
|
|
|
faster than copying it from the network.
|
|
|
|
|
|
Also, if you are changing to a new hostname, do not forget to change
|
|
|
it on the new server:
|
|
|
|
|
|
ssh new.example.net /root/BTCPayServer/btcpayserver-docker/changedomain.sh btcpay.torproject.org
|
|
|
|
|
|
In any case, make sure to update the target of the donation form on
|
|
|
`donate.torproject.org`. See for example [merge request
|
|
|
tpo/web/donate-static!76](https://gitlab.torproject.org/tpo/web/donate-static/-/merge_requests/76).
|
|
|
|
... | ... | |