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.x. |
The migration is completed by following the steps below.
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 |
Use the pg_dump version that has the same major version as the destination database. Do not use pg_dump from the BDR version of PostgreSQL.
/usr/lib/postgresql/<major version>/bin/pg_dump --host=localhost --username=centerui --no-privileges --no-owner --schema=public --exclude-table=xroad_bdr_replication_info --dbname=centerui_production --format=c -f center.dmp |
Restore the dump to the new database: 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();" |
/etc/xroad/db.properties
with information about the new database.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 appear here based on the labels you select. Click to edit the macro and add or change labels.
|