Prerequisites

This guide assumes that all parts of openBIS (application server, data store server and database) are running on the same machine. The file system of the data store is expected to be on separate file server (e.g. a NAS) which can be mounted from both, the old and the new machine.

The new machine needs to have Oracle Java 1.6 and PostgreSQL 8.4 installed and PostgreSQL included in the init process. Configurations to check on the new server are:

  • Is sendmail enabled? Is the smart host set to smtp0.ethz.ch?
  • Is ntpd enabled? Is -x given to enabled to initially call ntpdate?

Preparation

Enable online-backups on the old database server and perform a full database backup

Follow the how-to in Enable online backup in PostgreSQL to enable online-backups and perform a full backup on the old database server, if that has not yet done. These backups will be used to migrate the database.

File shares

Ensure that on the new server you mount all remote shares used for openBIS (the data store and all drop boxes) to the same mount points as on the old server.

User account

Create a user account openbis on the new machine and ensure the account has the same uid as on the old server.

openbis home

Copy the home directory of user openbis to the new machine.

SSL Certificates

On the new machine, replace the jetty keystores in both, AS and DSS, with the keystore for the new machine.

If users access PostgreSQL directly via remote, copy server.crt and server.key to the pgdata directory on the new server.

Startup configuration

Ensure that both PostgreSQL and the openBIS servers are included in the startup sequence. Note that copying over /etc/init.d/openbis will not be sufficient

Tests

Make sure you disable all inputs in the service.properties of DSS by commenting out the according line! Otherwise the two DSSes, the old one and the new one, will compete to process incoming data!

Perform a test migration (see below). Ask a user to verify that the application works for them.

They must not modify the data store (e.g. by deleting a data set) in the process as the data store is shared between the old and the new server!

Migration

  1. Copy last full database backup to /var/lib/pgsql or wherever your database resides on the new machine.
  2. If you have changed the postgresql.conf for the new machine, copy it now to /var/lib/pgsql/data on the new machine
  3. Copy a recovery.conf to the /var/lib/pgsql on the new machine that looks something like
  4. Revert the changes you did to service.properties on the new machine, i.e. commenting out inputs
  5. Remove jetty/indices from the {openBIS-server}} directory on the new machine (it has to be generated anew when the database is up-to-date)
  6. Remove the openBIS DSS and AS from the startup sequence of the old machine
  7. Set archive_mode = off in the postgresql.conf on the old machine
  8. Stop the openBIS DSS on the old machine (This is where the downtime begins)
  9. Stop the openBIS AS on the old machine
  10. Stop the PostgreSQL server on the old machine
  11. Copy any usable WAL segments from data/pg_xlog/ *from the old machine to the new machine
    restore_command = '/bin/cp /mnt/local0/db-backups/pg_xlog/%f "%p"'
    
    It needs to get the WAL segments from wherever the old database server archived them to.
  12. Start the PostgreSQL server on the new machine (it will be in recovery mode)
  13. Wait until the recovery is done (check data/pg_log) on the new machine
  14. Start up the openBIS AS on the new machine
  15. Start up the openBIS DSS on the new machine (This is where the downtime ends)
  16. You might want to wait until the new server has re-created the lucene indices before telling user the server is available again, as otherwise you might get error messages about "missing data" (i.e. the Advanced Search options don't find the data as the indices are not yet up-to-date).
  17. Ensure the data on the new machine gets properly backed up!

Done!

  • No labels