Skip to content

Remote backup

Lukas Bestle edited this page Oct 2, 2021 · 1 revision

As the Versions plugin just uses a simple Git repository under the hood, you can backup your site's content using Git.

Use case

Even though most hosting providers automatically create backups of your site, you shouldn't rely on these backups. If the whole data center burns down, your data will be lost and in most contracts you will be responsible for any data loss.

This is why backing up your content and versions externally is strongly recommended.

Setup steps

First, create a Git repository on the backup destination and set it up as a remote in your content repository on the server:

git remote add origin <URL>

Now you can create a cronjob that runs regularly (for example daily at night) that runs the following command to backup all versions to the remote:

git -C /var/www/your-site/content push --tags origin

Note: If your site's content is larger than a few hundred MB, please first check with your Git hosting service that they are OK with using them as a backup destination. GitHub for example doesn't like repos larger than 1 GB.

Alternative ways of creating backups of your content are:

  • Creating an empty repository on another server (anywhere in the file system) and using it as a remote over SSH (with user@domain:/path/to/the/repo).
  • Creating an empty repository on your local machine and adding your site's content directory as a remote so you can fetch versions from it manually every now and then.
  • ...
Clone this wiki locally