Migration from Greenplum 6 to Greengage DB 6
This topic explains how to migrate an existing Greenplum 6 cluster to Greengage DB 6.
Greengage DB 6.x is binary-compatible with Greenplum Database 6.x, meaning the compiled binaries, on-disk data formats, and system catalogs are compatible. Therefore, you do not need to re-create the cluster. The migration process is similar to a minor version upgrade within Greenplum 6.x.
Prerequisites
Perform a full backup
Before proceeding with the migration, perform a full backup of your Greenplum Database cluster.
Verify hardware performance
Verify that the host hardware is healthy and meets the system requirements for Greengage DB. Run the gpcheckperf utility to assess system performance and confirm that the hosts meet these requirements.
Check catalog tables for inconsistencies
Test Greenplum Database catalog tables for inconsistencies using the gpcheckcat utility.
Note that you must start Greenplum Database in restricted mode (gpstart -R) before running this utility.
If gpcheckcat reports catalog inconsistencies, you can run it with the -g option to generate SQL scripts to fix them.
After executing the generated SQL scripts, run gpcheckcat again.
You might need to repeat this process multiple times to ensure that all inconsistencies are resolved.
Run the generated SQL scripts on an idle system, as concurrent activity may cause false alerts.
Stop the PXF service
If the Greenplum Platform Extension Framework (PXF) is configured in your Greenplum Database installation, stop the PXF service before migrating to Greengage DB. You may also need to back up PXF configuration files to preserve your settings.
If PXF is not configured, no action is required.
Migrate from Greenplum to Greengage DB
Migrating a cluster from Greenplum Database 6.x to a 6.x release of Greengage DB requires stopping the cluster, installing the Greengage DB software, and then starting the cluster.
Stop the cluster
Log in to the Greenplum Database master host as the administrative user:
$ sudo su - gpadmin
Perform a smart shutdown of the Greenplum Database 6.x cluster. Ensure that there are no active connections to the database before running this command:
$ gpstop
Install Greengage DB
Install Greengage DB on each host. For more information, see the following topics:
For example, if installed from a package, Greengage DB is located at /opt/greengagedb/greengage6/.
Update environment
After installing Greengage DB, update the environment variables for the gpadmin user on both the master and standby master hosts.
This can be done by editing the gpadmin profile file, such as .bashrc.
Example of the previous Greenplum DB environment setup:
source /opt/greenplum-db-6/greenplum_path.sh
Example for Greengage DB:
source /opt/greengagedb/greengage6/greengage_path.sh
Apply the changes to the current session:
$ source ~/.bashrc
Start the cluster
Log in to the Greengage DB master host as the administrative user:
$ sudo su - gpadmin
Start the cluster:
$ gpstart
Reinstall extensions
Use the gppkg utility to reinstall any previously installed Greenplum Database extensions, such as PL/Java, PL/R, PostGIS, or MADlib, after migrating to Greengage DB.
Also, copy any files required by the extensions — such as JAR files, shared object files, and libraries — from the previous installation directory to the new installation directory on both the master and segment hosts.
Reinitialize PXF
If PXF was configured in your previous Greenplum Database installation, you may need to install PXF in Greengage DB and reinitialize or register the PXF service.
For example, use the pxf cluster register command to copy the PXF extension files from the previous installation catalog to the new Greengage DB catalog on the host.
Ensure that the GPHOME environment variable is set to the Greengage DB installation directory, not the previous Greenplum installation.
Then, start the PXF service to make it available for queries to external tables.
Verify the cluster
After migrating from Greenplum Database to Greengage DB, verify that all features function as expected. For example, confirm that backup and restore operations succeed, and that Greengage DB features, such as user-defined functions and extensions like MADlib and PostGIS, function correctly.
Changes to server version string
After migration, client applications may require updates because the server version string now includes Greengage Database instead of Greenplum Database.
For example, on a Greenplum Database system, the command SELECT version(); might return:
PostgreSQL 9.4.26 (Greenplum Database 6.23.0+dev.190.gc3e5acdb5b build dev-oss) on x86_64-pc-linux-gnu, compiled by gcc-11 (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0, 64-bit compiled
On a Greengage DB system, the same command might return:
PostgreSQL 9.4.26 (Greengage Database 6.30.1 build commit:56d8146ce049c838caf75bd85df67fe55d9beffc) on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0, 64-bit compiled
Ensure that any scripts, monitoring tools, or drivers (such as JDBC, ODBC, or libpq) that parse the server version string are updated to handle the new product name correctly.