How to back up your ResourceSpace installation

It is vital to ensure all parts of ResourceSpace containing your resource files and metadata are backed up on a regular basis.

For our Cloud Hosted systems, be assured that extensive backup processes are in place and monitored regularly. This guide is for On-Premise or unsupported users.

The ideal scenario - server or VM image

The perfect scenario is to backup the entire server (or virtual machine) that is hosting ResourceSpace and all your resource files. This means recovery time is minimal as there's nothing to reconfigure. This involves taking a complete image of the system on a regular basis, and your organisation may have existing backup systems capable of this.

Backup of files and metadata only

If a full system backup is not possible, the following steps can be taken to ensure ResourceSpace is backed up. These should be incorporated into a scheduled script as appropriate.

  1. Use the mysqldump utility to dump the ResourceSpace MySQL database to export files.
    • Example command:
      mysqldump -u root resourcespace > resourcespace.sql
  2. Take a backup copy of the exported database dump.
  3. Take a backup copy of the complete ResourceSpace installation folder.
    • On a Linux server the location may be /var/www/resourcespace
    • On a Windows server the location may be C:\inetpub\wwwroot\resourcespace
  4. If the filestore folder is configured to be external to the ResourceSpace installation folder, ensure this is backed up too (otherwise you may be simply backing up a shortcut to the filestore folder).

Scheduled backups

The process above should ideally be run automatically with a recurring process on the server. On a Linux server this can be done with a cron job and on Windows the Task Scheduler program can be used.

Example Linux automated backup

Create a shell script containing the commands to back up the database and web root folder along with a timestamp with the following example contents:

#!/bin/bash

mysqldump -uDBUSERNAME -pDBPASSWORD dbname > /server/backup/folder/rs-db-backup-'date +%Y%m%d'.sql

cp -b /var/www/resourcespace /server/backup/folder/rs-webroot-backup-'date +%Y%m%d'

Replace DBUSERNAME, DBPASSWORD and dbname with the config options $mysql_username, $mysql_password and $mysql_db found in include/config.php

Make the script executable by adding the permission to the file:

chmod +x /path/to/script/backup_script.sh

Open the crontab editor:

crontab -e

Add the line below to run the backup script every day at 1am:

0 1 * * * /path/to/script/backup_script.sh

The 3-2-1 backup strategy

It's advisable to follow the 3-2-1 rule for backup copies.

  • Keep at least 3 copies of your data - your live copy and two further backup copies.
  • Store the copies on at least 2 different media devices.
  • Ensure that at least 1 of your copies is offsite and rotate your offsite backups regularly.