How-To: Export a Backup¶
To restore and export a backup from the ComputeStacks backup agent, you will need administrator access to one of the nodes that has access to that particular backup.
Step 1: Prepare the machine¶
- Login via ssh and gain root access.
-
Create an export directory, for example
/root/backup-export.
Step 2: Launch a backup container with the data mounted¶
-
Aquire the backup encryption key. This can be found in
/etc/computestacks/agent.ymlunderbackups.key.Warning
If your key has a
$character in it, be sure to escape that before adding it to the container (\$). -
Determine the backup volume name.
- Login to the ComputeStacks controller and navigate to: the project → data volumes → click on the volume
- Below the overview details, you will see a UUID in the gray footer. The backup volume name will be:
b-<the-volume-UUID>.
-
Create the backup container.
docker run -it --rm -l com.computestacks.role=backup \ -e BORG_PASSPHRASE="BACKUP-KEY" \ -e BORG_BASE_DIR=/mnt/borg \ -v b-{{ volume-UUID }}:/mnt/borg \ -v /root/backup-export:/mnt/export \ cmptstks/borg:stable ashThis will launch the container and place you into an interactive shell.
Step 3: Extract your backup data¶
-
List all available backups
Note
-
(Optional) List files in the backup
-
Extract backup into directory
# example: cd /mnt/export && borg extract /mnt/borg/backup::test-m-2022-10-12T22:34:43 cd /mnt/export && borg extract /mnt/borg/backup::{{ archive name outputted in previous command }}Note
https://borgbackup.readthedocs.io/en/stable/usage/extract.html
-
You may now exit the container:
The container will be automatically stopped & deleted upon exit.
Step 4: Cleanup¶
Your files will now be in the directory you initially setup (e.g. /root/backup-export). You can now compress that entire directory and transfer it wherever it needs to go.