Torrent Suite SoftwareAdministration Guide


Torrent Suite Software space on Ion Community

Administration Guide TOC

Back Up and Restore Data

The Torrent Server maintains the following types of data in separate locations:

  • Ion PGM Sequencer data are storedin the /results/< PGM_Name > directory, by default.
  • Ion Proton Sequencer data are storedin the /rawdata directory, by default.
  • Report data are stored in the /results/analysis/output/Home directory, by default.
  • Database records are stored in the PostgreSQL database.

Back up sequencer d ata

The easiest way to back up Ion PGM Sequencer data and report data is to backup the whole /results directory.

The easiest way to back up Ion Proton S equencer data and report data is to backup the whole /results and /rawdata directories.

If you have a backup storage location on the network with sufficient capacity, you are encouraged to use the rsync utility to periodically backup the repository over the network.

The Torrent Browser Data Management utility export function can also be configured to move sequencer data to offlinestorage. The Data Management utility works on individual analyses and file categories, not on whole directories such as /results or /rawdata . See the Data Management Guide .

Back up the PostgreSQL database

Database records hold the run, report and configuration data viewed using the Torrent Browser interface. Compared to the raw data and report data, database records are relatively easy to backup because the database size is only a few hundred megabytes.

To backup the database, run the following command:

             pg_dump -U ion -c iondb > backup_file
            

Use the following simple example script to automate the database backup, calling the script from a cron job:

             #!/bin/bash
cd /path/to/backup/directory
TIMESTAMP=$(date +%Y%m%d_%k%M%S)
pg_dump -U ion -c iondb > iondb.$TIMESTAMP.backup
gzip iondb.$TIMESTAMP.backup
rm -f iondb.$TIMESTAMP.backup
            

This produces a compressed backup file with a name like iondb.20100711_142442.backup.gz .

Restore the PostgreSQL Database

Icon

The following instructions delete the current database.

To restore the database, you need a complete working Torrent Server installation.

The two scenarios for restoring a database are:

  • Installing a new Torrent Server from the Torrent Server installation disk due to migrating the database to a new server or needing to reinstall the server.
  • Replacing the database on an existing Torrent Server, possibly because the database is corrupted and you want to restore a previous version.

To restore the database from the backup file, execute these commands on the Torrent Server:

             # copy the backup file to the server and decompress it
gzip -d iondb.20100711_142442.backup.gz

# stop the Torrent Server background processes
sudo /etc/init.d/ionCrawler stop
sudo /etc/init.d/ionJobServer stop
sudo /etc/init.d/ionPlugin stop
sudo /etc/init.d/celeryd stop

# login as user postgres
sudo su postgres

# restart the service to clear database connections
/etc/init.d/postgresql-8.4 restart

# drop the existing iondb database
dropdb iondb

# create a new empty database
psql <<-EOFdb
CREATE DATABASE iondb;
GRANT ALL PRIVILEGES ON DATABASE iondb to ion;
\q
EOFdb

# import data
psql -e iondb < iondb.20100711_142442.backup

# logout of user postgres
exit

# start the Torrent Server background processes
sudo /etc/init.d/ionCrawler start
sudo /etc/init.d/ionJobServer start
sudo /etc/init.d/ionPlugin start

sudo /etc/init.d/celeryd start
            
Icon

Occasionally, there is a django error after completing the import data step.

If an error is displayed on the browser UI, repeat the following steps:

  1. Drop database.
  2. Create database.
  3. Import data.