diff --git a/Wallet-Server-Snapshot-Create-Deploy-Revert.md b/Wallet-Server-Snapshot-Create-Deploy-Revert.md new file mode 100644 index 0000000..16b5b7e --- /dev/null +++ b/Wallet-Server-Snapshot-Create-Deploy-Revert.md @@ -0,0 +1,28 @@ +**To make a new snapshot:** + +1. turn the wallet server being cloned off with `docker-compose down` +2. copy the volume `sudo cp -r /var/lib/docker/volumes/${USER}_wallet_server/_data/ /home/${USER}/snapshot` +3. update the permissions `sudo chown -R ${USER}:${USER} snapshot` + +**Deploying a volume snapshot:** + +1. from wherever you have the `snapshot` directory, rsync it to the target server: `rsync -avP snapshot ${HOST_USER}@${HOST}:/home/${HOST_USER}/snapshot/` , HOST_USER would be `lbry` and HOST would be a server like `spv13.lbry.com` +2. ssh into the target server and run `ls snapshot` to verify it received in the right place, you should see `blocks` files, `claims.db`, `tx`, `utxo`, etc. +3. check the permissions on the existing volume with `sudo ls -lah /var/lib/docker/volumes/${USER}_wallet_server/` you should see the directory is owned by `root:root` and it contains `_data` , which is owned by `netdata:netdata` +4. update the permissions on the new snapshot `sudo chown -R netdata:netdata snapshot` +5. turn the wallet server off with `docker-compose down` +6. back up the existing volume instead of deleting it, `sudo mv /var/lib/docker/volumes/${USER}_wallet_server/_data volume_backup` +7. move the prepared snapshot into place `sudo mv snapshot /var/lib/docker/volumes/lbry_wallet_server/_data` +8. double check the permissions on the resulting voiume: `sudo ls -lah /var/lib/docker/volumes/${USER}_wallet_server/` you should see `_data` owned by `netdata:netdata` like before +9. start the wallet server `docker-compose up -d` +10. watch the log tail until it starts successfully, indicated by ips showing in the logs as users connect `docker-compose logs -f --tail 100` + +**Restoring a backup volume** + +1. set the permissions on the backup `sudo chown -R netdata:netdata volume_backup` +2. turn the wallet server off with `docker-compose down` +3. back up the existing volume instead of deleting it, `sudo mv /var/lib/docker/volumes/${USER}_wallet_server/_data volume_backup2` +4. move the prepared snapshot into place `sudo mv volume_backup /var/lib/docker/volumes/${USER}_wallet_server/_data` +5. double check the permissions on the resulting voiume: `sudo ls -lah /var/lib/docker/volumes/${USER}_wallet_server/` you should see `_data` owned by `netdata:netdata` like before +6. start the wallet server `docker-compose up -d` +7. watch the log tail until it starts successfully, indicated by ips showing in the logs as users connect `docker-compose logs -f --tail 100` \ No newline at end of file