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 tosmtp0.ethz.ch
? - Is
ntpd
enabled? Is-x
given to enabled to initially callntpdate
?
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
- Copy last full database backup to
/var/lib/pgsql
or wherever your database resides on the new machine. - If you have changed the
postgresql.conf
for the new machine, copy it now to/var/lib/pgsql/data
on the new machine - Copy a
recovery.conf
to the/var/lib/pgsql
on the new machine that looks something like - Revert the changes you did to
service.properties
on the new machine, i.e. commenting outinputs
- 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) - Remove the openBIS DSS and AS from the startup sequence of the old machine
- Set
archive_mode = off
in thepostgresql.conf
on the old machine - Stop the openBIS DSS on the old machine (This is where the downtime begins)
- Stop the openBIS AS on the old machine
- Stop the PostgreSQL server on the old machine
- Copy any usable WAL segments from
data/pg_xlog/
*from the old machine to the new machineIt needs to get the WAL segments from wherever the old database server archived them to.restore_command = '/bin/cp /mnt/local0/db-backups/pg_xlog/%f "%p"'
- Start the PostgreSQL server on the new machine (it will be in recovery mode)
- Wait until the recovery is done (check
data/pg_log
) on the new machine - Start up the openBIS AS on the new machine
- Start up the openBIS DSS on the new machine (This is where the downtime ends)
- 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).
- Ensure the data on the new machine gets properly backed up!
Done!