Go to page content

Backing up your site

A short guide to backing up your site content over SSH.

Why

Losing data is bad for business.  This applies to your customers as well if you are building sites for them.  It is critical to keep backups of any Zotonic sites you develop.  This guide provides steps to enable and make effective use of Zotonic backup files.

Assumptions

Applies to: Zotonic 0.6 or later
Assumes: SSH Server

How

  1. Select Modules from your Zotonic admin menu
  2. Activate Backup
  3. Logout
  4. Wait 24 hours
  5. From your zotonic home directory:
    cd zotonic/priv/sites/yoursite>/files/backup
    You should see two files that look more or less like this:
    20110411-030000.sql
    20110411-030000.tar.gz
  6. Copy or move these to an appropiate remote store. Your local computer would do fine. The scp commands called from a back-up directory on a local machine would look like this:
    scp -P <port no> -r zotonic@<your ip or url>:/<path to back up files> .
    Example:
    scp -P 22 -r zotonic@myurl.com://home/zotonic/zotonic/priv/sites/default/files/backup/ .
    Clearly, Step 5 could be incorporated into a chron script.

Troubleshooting

There are no troubleshooting steps available for this guide at this time.  Please share any you have encountered either in the comments below or on the Zotonic Users Group.

This page is part of the Zotonic documentation, which is licensed under the Apache License 2.0.