This topic contains steps to get you quickly up and running with the gpupgrade utility.

See also the section About Log Files for details about logging in the upgrade process.

Quick Start Steps

Install the Latest Greenplum 6X Version on All Hosts

  1. Copy the Greenplum 6 package to the /tmp directory on all hosts:

    $ gpscp -f all_hosts greenplum-db-6*rpm =:/tmp
  2. Install the Greenplum 6 package on all hosts:

    $ gpssh -f all_hosts -v -e 'sudo yum install -y /tmp/greenplum-db-6*rpm'

Install the gpupgrade Package on All Hosts

  1. Download the gpupgrade package from VMware Tanzu Network and copy it to the /tmp directory on all hosts:

    $ gpscp -f all_hosts gpupgrade*.rpm =:/tmp
  2. Install the gpupgrade package on all hosts:

    $ gpssh -f all_hosts -v -e 'sudo yum install -y /tmp/gpupgrade*rpm'

Generate Data Migration Scripts

Since some objects are not upgradeable, data migration scripts can help upgrade them – for example, by altering them to a compatible type, or by dropping and recreating them.

$ gpupgrade-migration-sql-generator.bash $GPHOME $PGPORT $HOME/gpupgrade

Run Pre-Initialize Data Migration Scripts

$ gpupgrade-migration-sql-executor.bash $GPHOME $PGPORT $HOME/gpupgrade/pre-initialize

Run initialize

NOTE: See Prepare the Source Cluster for additional steps to take before starting the initialize phase.

Copy the example config file to $HOME/gpupgrade/ and update the required parameters source_gphome, target_gphome, source_master_port, and – if upgrading with extensions whose install location is not in target_gphome – the dynamic_library_path parameter.

$ cp /usr/local/bin/greenplum/gpupgrade/gpupgrade_config  $HOME/gpupgrade/

Then run initialize:

$ gpupgrade initialize --verbose --file $HOME/gpupgrade/gpupgrade_config

See the gpupgrade Initialize Phase topic for more information on updating the configuration file.

NOTE: If you are upgrading with extensions, the initialize command will fail during the pg_upgrade checks phase, as the extensions are not yet installed in the target cluster. You must follow a few extra steps and then issue the initialize command again. See Running gpupgrade Initialize for further details.

Run revert (Optional)

Reverting returns the cluster to its original state. This stops the upgrade, removes any upgrade artifacts, and restores the source cluster. It can only be used after initialize and execute, and is “not” allowed during finalize.

$ gpupgrade revert --verbose

To restore any non-upgradeable objects run the “post-revert” data migration scripts:

$ gpupgrade-migration-sql-executor.bash $GPHOME $PGPORT $HOME/gpupgrade/post-revert

If gpupgrade revert fails, you may revert the cluster manually with the following command:

$ gpssh -f all_hosts -v -e 'rm -rf $HOME/.gpupgrade && gpupgrade kill-services && pkill gpupgrade'

Run execute

$ gpupgrade execute --verbose

Run finalize

$ gpupgrade finalize --verbose

Update the GPDB symlink

$ gpssh -f all_hosts -v -e 'sudo rm /usr/local/greenplum-db && sudo ln -s /usr/local/greenplum-db-6* /usr/local/greenplum-db'

Start the Target Cluster

In a new shell:

$ source /usr/local/greenplum-db-6*/
$ gpstart -a

NOTE: See the Post-upgrade topic for additional steps to take after you complete finalize.

Run Post-Finalize Data Migration Scripts

$ gpupgrade-migration-sql-executor.bash $GPHOME $PGPORT $HOME/gpupgrade/post-finalize

Log Locations

Where to find log files:

  • gpupgrade logs are located on each host in $HOME/gpAdminLogs/gpupgrade.

  • pg_upgrade logs are in the subdirectory $HOME/gpAdminLogs/gpupgrade/pg_upgrade.

  • gpupgrade calls Greenplum utilities such as gpstart and gpstop – these utilities’ logs are located in $HOME/gpAdminLogs on each host.

  • The source cluster’s pg_log files are located in $MASTER_DATA_DIRECTORY/pg_log.

  • The target cluster’s pg_log files are located in $(gpupgrade config show --target-datadir)/pg_log.

Once finalize has completed, the $HOME/gpAdminLogs/gpupgrade directory is archived with the upgradeID and timestamp.

check-circle-line exclamation-circle-line close-line
Scroll to top icon