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.  2023.  2023.
2023.  2023.  2023.
2023.  2023.
2023.  2023.

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.
postgresql.tar.gz.aa  postgresql.tar.gz.ab

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. ~/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