Personal tools
  • We're Hiring!

You are here: Home Documentation Previous versions OME Server System Administration Backup and Restore

Backup and Restore

OME Data

Most OME data e.g. user settings, image meta-data, analysis modules, chains, and the results of module executions is stored in the Postgress database. For details about the database's tables read the new users section of the developer documentation. The image pixels, original image files, and other large blobs are stored in the OME repository managed by the OME Image Server (OMEIS). The OME repository is a set of files stored on disk under a managed directory structure. Usually this directory is /OME/OMEIS/. For more information, read about OMEIS.

Changing Data Ownership

OME attributes, images, datasets, and projects are associated with an experimenter and a group. Similar to UNIX file permissions, OME implements rules for access permissions based on the OME object's experimenter.

OME Commander provides functionality for changing the group and user ownership of projects, datasets and images:

For example, to change group and user permissions for an image do:

ome data chown -g OME -u igg -i Image1 "My other image"

Deleting Data

ome data delete deletes all the descendant outputs of a module (or chain) execution. This makes it very easy to delete lots of data including images (from OME and OMEIS) and attributes. It is highly recommended to execute the command first with the -n parameter to see what would be deleted.

ome data delete Image -n obj_198_1
Retrieved MEX ID = 112
Retreived Image ID = 1, Name = obj_198_1
++MEX 26: Image import
  Image 1 obj_198_1
  Image MEX 28

  ... SNIP ... 
  --MEX 27: Stack statistics (image server)
      Reference from Attribute 39 (PixelChannelComponent)
      Attribute 38 (LogicalChannel)
      Attribute 39 (PixelChannelComponent)
      Reference from Attribute 44 (DisplayOptions)
      Attribute 43 (DisplayChannel)
      Attribute 42 (DisplayChannel)
      Attribute 41 (DisplayChannel)
      Attribute 40 (DisplayChannel)
      Attribute 44 (DisplayOptions)
      Attribute 36 (Pixels)
    Dataset Link to Test Image, ID=1
    Unlocking Dataset Test Image, ID=1
  Actual input 4
  Actual input 3
  Output = Dimensions (Dimensions)
  Output = Pixels (Pixels)
  Output = *** Untyped *** (LogicalChannel)
  Output = *** Untyped *** (PixelChannelComponent)
  Output = *** Untyped *** (DisplayChannel)
  Output = *** Untyped *** (DisplayOptions)
  Untyped output 10
  Untyped output 11
  Untyped output 12
  Untyped output 13
  Node execution 26
  Orphaned MEX 25: Original files
  ++MEX 25: Original files
    Actual input 2
    Output = Files (OriginalFile)
        Attribute 37 (OriginalFile)
    Node execution 25
    Actual input 2
  --MEX 25: Original files
  Actual input 4
  Actual input 3
  Actual input 2
--MEX 26: Image import
Analysis Chain Execution 1, Image server stats (Chain ID=2)
Deleting OMEIS Pixels 4:1
Deleting OMEIS File 4:27

Backing up Data to Archive

Execute the following command to capture the contents of OME in a compressed tar archive. You can also pass the q flag (short for quick) into ome to only backup the OME Postgress database (and not the pixels data in the image server).

sudo ome data backup
Backup to archive [/Users/tmacur1/ome_backup_2006-07-28]: 
Warning: You have elected to backup OMEIS. Use the -q flag if this was not your
intention. Be advised that this operation, depending on the size of your OMEIS
repository (its size and location are printed below), is likely to take a long time.
793M    /OME/OMEIS
Continue? [y/n]: y
------------
 OME Backup
------------

    \_ Backing up postgress database ome
su postgres -c '/usr/local/bin/pg_dump -Fc -o ome > /tmp/omeDB_backup'
    \_ Backing up OMEIS from /OME/OMEIS 
/usr/bin/tar  -cf '/Users/tmacur1/TestImages/ome_backup_2006-07-28.tar' ...

Restoring from Archive

To restore your database from archive use the following commands:

dropdb ome
DROP DATABASE

If upon execution of the dropdb ome command you get the following output, it most likely means the web-ui has left locks on the ome database handle. To fix this, restart the apache webserver.

ERROR:  DROP DATABASE: database "ome" is being accessed by other users
dropdb: database removal failed
sudo ome data restore
Restore from archive [ome_backup_2006-07-28.tar]: 
-------------
 OME Restore
-------------

    \_ Extracting postgres database ome and checking archive version 
/usr/bin/tar  --preserve-permissions --same-owner --directory /tmp -xf
              'ome_backup_2006-07-28.tar' OMEmaint omeDB_backup
    \_ Checking archive for OMEIS files 
/usr/bin/tar  -tf 'ome_backup_2006-07-28.tar' Files/lastFileID
Warning: You have elected to restore OMEIS. Use the -q flag if this was
not your intention. Be advised that this operation, depending on the size
of your OMEIS repository (its estimated size is printed below), is likely
to take a long time.
-rw-r--r--   1 root  tmacur1       778M Jul 28 10:40 ome_backup_2006-07-28.tar
Continue? [y/n]: y
Restoring OMEIS from archive will delete all current files in /OME/OMEIS.
Continue ? [y/n]: y
    \_ Restoring OMEIS to /OME/OMEIS from archive
/usr/bin/tar  --preserve-permissions --same-owner --directory /OME/OMEIS -xf
              'ome_backup_2006-07-28.tar' Files Pixels
    \_ Restoring postgress database ome
Checking database
Database ome (version 2.25) was found and it will be overwritten. Continue
? [y/n]: y
su postgres -c '/usr/local/bin/createuser --adduser --createdb  ome'
createuser: creation of new user failed: ERROR:  user "ome" already exists
su postgres -c '/usr/local/bin/createdb  -T template0 ome'
CREATE DATABASE
su postgres -c '/usr/local/bin/pg_restore  -O -d ome ...

The above command generates alot of output. Most "fatal errors" such as those encountered above can safely be ignored. The easiest and most expedient way to verify if the restore command was successful is to attempt to use the web-ui to view your data.

Document Actions