Restore (as a task)

Install Restic

Using fabric:

cd ~/dev/module/fabric/

Restore the database:

fab restore:backup

Restore files:

fab restore:files

To check the date of all your backups:

fab check


There are several ways to diagnose a problem with the backup:

  1. When you start a files restore, you can see the date of the backup e.g:

    restoring <Snapshot 52bb5c15 of [/home/web/repo/files/] at 2019-02-25 01:04:54.115006483 +0000 UTC by @cloud-a> to /tmp/tmp5gitu21o

This backup was taken on the 25th February which would indicate either no backup since the 25th February or no files have changed since then.

  1. There is a fabric command which will display the date and time of all the backups:

    cd ~/dev/module/fabric/
    fab check

The backup date is highlighted in red when it isn’t today. A red date doesn’t necessarily indicate a problem, it might just mean no files have changed since that date.

  1. You can ssh into the server and create a new backup:

    sudo -i -u web

    The backup command will start by creating a database backup and will then create a files backup. If you check the output of the command, you can see if the restic repository is locked (or not).


To unlock the restic repository you can run the following from your laptop:

# backup
restic -r unlock
# files
restic -r unlock

Other Notes