Skip to content

Backups

By default, we back up all Cito servers automatically each night, and store these backups for 7 days. The following are backed up:

  • All site data in /home
  • All MySQL databases in /var/lib/mysql
  • All cron jobs
  • All server config

We use the popular open-source backup tool Restic to carry out backups. You can find documentation on Restic here.

We monitor backups pro-actively.

Viewing backup jobs

You can view backup jobs via the Cito homepage, by scrolling to the Server Backups section.

Each backup is identified by a unique UUID. Backups are compressed by default.

Alt text

Need custom retention?

If you need longer backup retention for your Cito servers, please contact Support. An additional charge may apply.

Restoring backups

If you need a file, site or more restored, please contact our support team to request a restore. If you wish, you can also restore files directly yourself.

Do not attempt to restore MySQL databases yourself!

We take MySQL backups directly using the InnoDB data files on-disk. Please do not attempt to restore these files- you will break MySQL on your server if you try to do so.

Viewing snapshots via the CLI

source /.ps/backup/profile && restic snapshots

This command will show you each backup, including the date & time, and the directories included:

ID        Time                 Host               Tags        Paths
-----------------------------------------------------------------------------
056c7a19  2024-04-10 19:20:18  cito.prostack.dev              /etc
                                                              /home
                                                              /var/lib/mysql
                                                              /var/spool/cron
f05532c7  2024-04-11 13:14:01  cito.prostack.dev              /etc
                                                              /home
                                                              /var/lib/mysql
                                                              /var/spool/cron
-----------------------------------------------------------------------------

We can refer to snapshots by their ID (e.g. 056c7a19) or use latest for the most recent.

For example, to check what’s in /home for the latest backup:

cito~ # restic ls latest /home
repository ee2f2a61 opened (version 2, compression level auto)
[0:00] 100.00%  1 / 1 index files loaded
snapshot f05532c7 of [/home /var/lib/mysql /etc /var/spool/cron] filtered by [/home] at 2024-04-11 13:14:01.568741172 +0100 BST):
/home
/home/mywebsite
/home/mywebsite2
/home/wp
...etc

Restoring files

Use restic restore, passing in the snapshot name. You can use a colon to limit the restore to a specific directory (e.g. restic restore latest:/home/wp)

  • --target is used to indicate where to restore the files.

  • --include is used to include specific files (and --exclude does the opposite).

For example, to restore a single file, /home/wp/public_html/wp-config.php, run:

restic restore latest:/home/wp/public_html/ --target /home/wp/public_html/ --include 'wp-config.php'

To restore a whole directory, run:

restic restore latest:/home/wp/public_html/ --target /home/wp/public_html/

Restoring to an alternate directory

Use --target to restore files to an alternate directory:

restic restore latest:/home/wp/ --target "/root/myrestore/"