• Views
  • Iteration Report
  • My Iteration Report
  •  
OMERO.server
  • Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • Start Page
  • Index
  • History
  • Last Change

Backing Up OMERO

Understanding backup sources

OMERO.server has three main backup sources:

  1. PostgreSQL database (assumed to be omero3)
  2. OMERO.server installation directory
  3. OMERO.server binary data store (assumed to be /OMERO)

(1) and (3) should be backed up regularly and (2) really only needs to have the contents of etc kept somewhere safe. You can ensure it is kept safe by copying its contents into /OMERO/backup as root:

# rsync -vaP ~/omero-3.0-Beta2.2/omero/etc /OMERO/backup

Backing up your PostgreSQL database

Database backups can be achieved using the PostgreSQL pg_dump command. Here is an example backup script that can be placed in /etc/cron.daily to perform daily database backups:

#!/bin/bash

DATE=`date '+%Y-%m-%d_%H:%M:%S-%Z'`
OUTPUT_DIRECTORY=/OMERO/backup/database
DATABASE="omero3"
DATABASE_ADMIN="postgres"

mkdir -p $OUTPUT_DIRECTORY
chown -R $DATABASE_ADMIN $OUTPUT_DIRECTORY
su $DATABASE_ADMIN -c "pg_dump -Fc -f $OUTPUT_DIRECTORY/$DATABASE.$DATE.pg_dump"

Other database backup configurations are outside the scope of this document but can be researched on the PostgreSQL website here (Chapter 23. Backup and Restore).

Backing up your binary data store

To simplify backup locations we have, in this document, located all database and configuration backups under /OMERO. The entire contents of /OMERO should be backed up regularly as this will, especially if this document's conventions are followed, contain all the relevant data to restore your OMERO.server installation in the unlikely event of a system failure, botched upgrade or user malice.

File system backup is often a very personal and controversial topic amongst systems administrators and as such the OMERO project does not make any explicit recommendations about backup software. In the interest of providing a working example we will use open source rdiff-backup project and like Backing up your PostgreSQL database above, provide a backup script which can be placed in /etc/cron.daily to perform daily /OMERO backups:

#!/bin/bash

FROM=/OMERO
TO=/mnt/backup_server

rdiff-backup $FROM $TO

rdiff-backup can also be used to backup /OMERO to a remote machine:

#!/bin/bash

FROM=/OMERO
TO=backup_server.example.com::/backup/omero

rdiff-backup $FROM $TO

More advanced rdiff-backup configurations are beyond the scope of this document. If you want to know more you are encouraged to read the documentation available on the rdiff-backup website here.

Restoring OMERO

There are three main steps to OMERO.server restoration in the event of a system failure:

  1. OMERO.server etc configuration
  2. PostgreSQL database (assumed to be omero3)
  3. OMERO.server binary data store (assumed to be /OMERO)

NOTE: It is important that restoration steps are done in this order unless you are absolutely sure what you are doing.

Restoring your etc configuration

Once you have retrieved an OMERO.server package from MilestoneDownloads that matches the version you originally had installed, all that is required is to copy your backed up etc configuration over the one in omero/etc. Then you should follow the Reconfiguration steps of OmeroInstall.

Restoring your PostgreSQL database

If you have had a PostgreSQL crash and database users are missing from your configuration, you should follow the first two (Create a non-superuser database user and Create a database for OMERO data to reside in) steps of OmeroInstall. Once you have ensured that the database user and empty database exist, you can restore the pg_dump file as follows:

sudo -u postgres pg_restore -Fc -d omero3 omero3.2007-12-05_16:27:29-GMT.pg_dump

Restoring your OMERO.server binary data store

All that remains once you have restored your etc configuration and PostgreSQL database is to restore your /OMERO backup.

Further reading

  • Wikipedia (list of backup software)
  • PostgreSQL 8.2 Interactive Manual (Chapter 23. Backup and Restore)
  • rdiff-backup (website)

See also: OmeroInstall, OmeroSecurity, OmeroAndPostgres, OmeroCommunity

Download in other formats:

  • Plain Text

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/