Download a backup from Cloud66

SSH into the database server containing the backups through the Cloud66 toolbelt

cx ssh -s stack_name -e production server_name

-s is your stack

-e is your environment (staging, production etc.)

gecko is Cloud66’s name for the server

The backups are usually stored in a weirdly named folder under /var/cloud66/backups/

cd into this folder

cd /var/cloud66/backups/SFkjndsfgk/

The backups for each day are saved with date and timestamp. The timestamp varies a bit. List the contents of this directory with ls:

2023.06.17.01.33.15  2023.06.21.01.33.15  2023.06.25.01.32.01
2023.06.18.01.33.14  2023.06.22.01.33.15  2023.06.26.01.32.02
2023.06.19.01.33.14  2023.06.23.01.33.15
2023.06.20.01.33.15  2023.06.24.01.32.03

Once the database has grown enough, the backup is saved and split into multiple files. List the contents of the backup you want, to see how many files you need to download:

user@server_name:/var/cloud66/backups/SFkjndsfgk$ ls 2023.06.26.01.32.02/result/archive/
postgresql.tar.gz.aa  postgresql.tar.gz.ab  postgresql.tar.gz.ac

You can now download each part of the database with the command below:

cx download -s stack_name -e production --server=server_name /var/cloud66/backups/SkRVQcYPHy/2023.02.16.01.40.02/result/archive/postgresql.tar.gz.aa ~/Downloads

As these files have been split, they need to be merged again

cat postgresql.tar.gz.a* > postgresql.tar.gz

And then unzipped:

tar xzf postgresql.tar.gz