This article explains how to migrate from a Central Server HA setup (<= v6.22) that uses PostgreSQL 9.4 with BDR 1.0.x to an external PostgreSQL database cluster.

This article is only for Central Server versions <= v6.22.

The migration is completed by following the steps below.

  1. Take a backup of the Central Servers.
  2. Update Central Servers to version 6.23.0 (or later). See Central Server High Availability Installation Guide for instructions.
  3. Create the destination database using DB super-user privileges:

    psql --host=<host> --username=<super-user, e.g. postgres> <<EOF
    create user centerui password '<password>';
    grant centerui to postgres; -- required e.g. by AWS RDS because the managed super-user does not have full privileges
    create database centerui_production owner centerui;
    \c centerui_production
    create extension hstore;
    EOF
    


  4. Stop Central Servers.
  5. Take a dump of the Central Server database:
  6. Restore the dump to the new database:
    (warning) Use pg_restore that has the same major version as the destination database.

    /usr/lib/postgresql/<major version>/bin/pg_restore --list center.dmp | sed '/FUNCTION public get_xroad_bdr_replication_info()/d' >center.list
    /usr/lib/postgresql/<major version>/bin/pg_restore --host=<host> --username=centerui --dbname=centerui_production --no-owner --single-transaction --use-list=center.list center.dmp
    psql --host=<host> --username=centerui --dbname=centerui_production -c "select fix_sequence();"


  7. Update the configuration file /etc/xroad/db.properties with information about the new database.
  8. (Re)start Central Servers.
  9. If the local PosgreSQL is not used by other applications, stop the local instance and prevent it from starting:

    sudo systemctl stop postgresql
    sudo systemctl mask postgresql


Related articles

Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.



Related issues