Hello, I’m DocuDroid!
Submitting feedback
Thank you for rating our AI Search!
We would be grateful if you could share your thoughts so we can improve our AI Search for you and other readers.
GitHub

ggupgrade overview

The ggupgrade utility upgrades a Greengage DB cluster in place to the next major version, for example, from Greengage DB 6 to Greengage DB 7. For the upgrade procedure, see Upgrade a Greengage DB cluster.

Installation

The ggupgrade package is available in the Greengage DB APT repository for Ubuntu 22.04. If the repository is not configured on a host, add it as described in Install Greengage DB from a package.

On every cluster host, install the package as a user with sudo privileges. The package depends on Greengage DB 6 and Greengage DB 7, so apt also installs any missing version:

$ sudo apt update
$ sudo apt install ggupgrade

The source code and releases of the utility are available in the ggupgrade repository on GitHub.

Synopsis

ggupgrade initialize { -f | --file } <config_file>
          [ -v | --verbose ]
          [ --pg-upgrade-verbose ]
          [ --seed-dir <directory> ]

ggupgrade execute [ --parent-backup-dirs <directories> ]
          [ -v | --verbose ]
          [ --pg-upgrade-verbose ]

ggupgrade finalize [ -v | --verbose ]

ggupgrade revert [ -v | --verbose ]

ggupgrade generate --gphome <path> --port <port>
          [ --seed-dir <directory> ]
          [ --output-dir <directory> ]

ggupgrade apply --gphome <path> --port <port>
          --phase { initialize | finalize | revert | stats }
          [ --input-dir <directory> ]

ggupgrade config show [ --upgrade-id ]
          [ --source-gphome ]
          [ --target-gphome ]
          [ --target-datadir ]
          [ --target-port ]

ggupgrade restart-services

ggupgrade [ <command> ] { -h | --help }

ggupgrade -V | --version

ggupgrade version [ --format { multiline | oneline | json } ]

Description

Overview

The utility upgrades the cluster in place in three phases: initialize (the source cluster keeps running), execute (the cluster is stopped), and finalize (the cluster is stopped). Run the following commands in this order:

  1. initialize — checks the cluster, applies the data migration scripts you select, creates the target cluster, and runs pg_upgrade --check. You do not need to initialize the target cluster yourself.

  2. execute — stops the source cluster and runs pg_upgrade on the master. It then copies the upgraded master data directory to the segment hosts and runs pg_upgrade on every primary segment. Finally, it starts the upgraded cluster on a temporary port. Mirror segments and the standby master are not upgraded at this step.

  3. finalize — upgrades the mirror segments and the standby master, if present, and makes the upgraded cluster available on the original port and in the original data directories.

You can return to the original state with revert after initialize or execute, but not after finalize has started.

IMPORTANT

From the start of initialize until the upgrade is finalized or reverted, do not perform operations on the source cluster. Do not run queries that modify the target cluster until finalize completes. These queries make the target cluster inconsistent with the source cluster.

Hub and agents

You run the ggupgrade command on the master host. The command sends your requests to two types of background processes: the hub and agents.

  • The hub runs on the master host and manages the upgrade. The hub listens on the port set by the hub_port parameter.

  • Agents run on segment hosts and on the standby master host, and perform the upgrade tasks on those hosts. The agents listen on the port set by the agent_port parameter.

The initialize command starts the hub and agents. The finalize and revert commands stop them. Do not stop the hub and agents while a ggupgrade command is running, for example, with ggupgrade kill-services.

Upgrade modes

The upgrade mode is set by the mode parameter:

  • copy — pg_upgrade copies the data files of the master and the primary segments into the data directories of the target cluster. The source cluster’s data files remain unchanged even after the target cluster starts at the end of execute. The revert command stops the target cluster, deletes its data directories, and starts the source cluster. The source cluster’s data files do not need to be restored. This mode requires disk space for a second copy of the data.

  • link — pg_upgrade creates hard links to the data files instead of copying them: the target and the source clusters share the same files on disk. Creating hard links is faster than copying the data files and requires almost no additional disk space. The source cluster’s files start changing during execute: pg_upgrade renames the pg_control files on the source master and segments to prevent the source cluster from being started accidentally. After creating the links, pg_upgrade also runs VACUUM FREEZE in every database on the master. Therefore, revert after execute restores the master from the standby master and the primary segments from the mirror segments. If the cluster does not have both a standby and mirrors for all primary segments, you cannot revert after execute has started. In this case, back up the cluster before you run execute.

Log and script files

On each cluster host, the utility writes its log files to the ~/gpAdminLogs/ggupgrade directory. By default, the generated data migration scripts are saved in the same directory on the master host. The files present on each host depend on the role of the host, as shown by the comments in the following structure:

~/gpAdminLogs/ggupgrade
├── cli_<YYYYMMDD>.log          # messages from the ggupgrade command (all hosts)
├── hub_<YYYYMMDD>.log          # messages from the hub (master host)
├── agent_<YYYYMMDD>.log        # messages from the agents (segment hosts, standby master host)
├── apply_<phase>.log           # output of the applied scripts (master host)
├── pg_upgrade_<timestamp>      # pg_upgrade output, one directory per run
│   ├── p-1                     # master (master host)
│   │   └── ...
│   └── p0, p1, ...             # primary segments (segment hosts with primary segments)
│       └── ...
└── data-migration-scripts      # master host
    ├── current                 # generated scripts: initialize, finalize, revert, stats
    │   └── ...
    └── archive                 # archived previous scripts
        └── ...

On any error, the command prints a NEXT ACTIONS block with instructions on how to proceed.

The initialize command runs the checks for plpython2u and unique indexes on partitioned tables before pg_upgrade. If either check finds objects that block the upgrade, it saves a list of these objects in a file in ~/gpAdminLogs/ggupgrade. The error message includes the full path to this file.

If the pg_upgrade checks on the master fail, the NEXT ACTIONS block points to the pg_upgrade_<timestamp>/p-1 directory. See p-1/log/pg_upgrade_internal.log for details. If a check finds objects that block the upgrade, the fatal block in this log includes the name of the file that lists these objects. Other text files in p-1 may be reports of checks that passed. If the pg_upgrade checks fail on the master, the segment checks do not run, so no p0, p1, …​ directories are created for this run.

If pg_upgrade fails on a primary segment, the error message contains only the host name and the content ID of the segment: upgrade primary on host <host> with content <N>: exit status 1. See pg_upgrade_<timestamp>/p<N>/log/pg_upgrade_internal.log on that host. If the segment instance failed to start, this log points to pg_upgrade_server.log, which explains the failure.

If pg_upgrade fails on the master during execute, the error message upgrade master: exit status 1 does not include a log path either. See pg_upgrade_<timestamp>/p-1/log/pg_upgrade_internal.log on the master host. Depending on the error, also check the following files in pg_upgrade_<timestamp>/p-1:

  • log/pg_upgrade_server.log — the server log if the master failed to start.

  • log/pg_upgrade_utility.log — output from helper utilities.

  • log/pg_upgrade_dump_<oid>.log — schema restore errors for the database with the specified OID.

Output from all hub steps, including the output of pg_upgrade on the master, is always written to hub_<YYYYMMDD>.log. To also print this output as the command runs, use --verbose.

After finalize or revert, the whole ~/gpAdminLogs/ggupgrade directory is moved to ~/gpAdminLogs/ggupgrade-<upgrade_id>-<timestamp> on each host and keeps the same structure. When the finalize or revert command applies migration scripts, it writes their output to the apply_<phase>.log files in the archived directory. If you apply the scripts later with the apply command, the command writes a new apply_<phase>.log file to the ~/gpAdminLogs/ggupgrade directory.

Prerequisites

Make sure that the following requirements are met before you start the upgrade:

  • The source cluster runs Greengage DB 6.32.0 or later when you upgrade to Greengage DB 7.

  • The target version of Greengage DB and the ggupgrade package are installed on all cluster hosts, in addition to the source version.

  • The extensions that use libraries, for example, PXF, are installed for the target version of Greengage DB on all cluster hosts. Otherwise, the pg_upgrade check during initialize fails at Checking for presence of required libraries.

  • When you run initialize, the PATH and LD_LIBRARY_PATH variables in the gpadmin user’s environment on all hosts, including the master host, do not include installation directories for the source or target version of Greengage DB. Otherwise, initialize stops with one of the following errors on each affected host:

    on host <host> PATH contains GPHOME
    on host <host> LD_LIBRARY_PATH contains GPHOME

    Remove or comment out the lines that source greengage_path.sh from .bashrc and .bash_profile on all hosts, and run ggupgrade in a new shell.

  • The shell in which you run ggupgrade initialize uses the same locale as the cluster databases, for example, LANG=en_US.UTF-8 and LC_ALL=en_US.UTF-8. Otherwise, the pg_upgrade check during initialize fails with the following error:

    lc_collate values for database "<name>" do not match:  old "<old_locale>", new "<new_locale>"
  • All client connections to the source cluster are closed before you run execute. Prevent clients from reconnecting to the source cluster until the upgrade is finalized or reverted.

Commands

The steps below summarize each command.

initialize

Runs the pre-upgrade checks and prepares the cluster for the upgrade. The upgrade parameters are read from the configuration file.

To review the data migration scripts before they are applied, generate them in advance with the generate command.

The initialize command is interactive. It shows the parameter values and asks you to confirm them. It also asks whether to archive or keep the existing generated scripts and which stats and initialize scripts to apply. The stats scripts only collect information about the cluster.

Before you run initialize, do the following:

  • Back up the source cluster (see Backup and restore).

  • Run gpcheckcat to check the catalog.

  • Run gpstate with the -e option to check that the segments are up and in their preferred roles.

Before you select the scripts, you can review them in the directory shown by the command. For the initialize scripts, select a (all) to apply them during the upgrade, s (some) to choose specific scripts, or n (none) to check for pg_upgrade errors without changing the source cluster. If you applied the initialize scripts in advance, select c (continue) when the command asks about the existing scripts. If you select a (archive and regenerate) instead, the new finalize and revert scripts do not re-create the objects that the initialize scripts dropped.

IMPORTANT

The initialize scripts change the source cluster. For example, they drop primary key, unique, and foreign key constraints and indexes on partitioned tables, change the type of tsquery columns to text, and drop the indexes and views that depend on these columns. Apply these scripts during a maintenance window when applications do not access the affected tables. The objects that the initialize scripts drop remain absent until the matching finalize or revert scripts are applied. The finalize scripts re-create only objects supported in the target version.

The command performs the following steps:

  1. Checks the source cluster for objects that cannot be upgraded to the target version.

  2. Generates the data migration scripts and applies the stats and initialize scripts you select to the source cluster.

  3. Checks the environment and free disk space on the hosts.

  4. Creates the target cluster.

  5. Runs the pg_upgrade checks.

After initialize, the source cluster is still running, and the target cluster is created but stopped.

Options: --file, --verbose, --pg-upgrade-verbose, --seed-dir

execute

Performs the main upgrade phase: upgrades the master and the primary segments to the target Greengage DB version. Run this command only during a downtime window. Disconnect all clients first: the command fails if there are active connections to the source cluster.

The command performs the following steps:

  1. Checks that there are no active connections to the source cluster.

  2. Stops the source cluster.

  3. Runs pg_upgrade on the master.

  4. Copies the upgraded master data directory to the segment hosts.

  5. Runs pg_upgrade on every primary segment.

  6. Starts the target cluster on a temporary port.

Mirror segments and the standby master are upgraded during finalize.

Options: --parent-backup-dirs, --verbose, --pg-upgrade-verbose

finalize

Completes the upgrade: upgrades the standby master and the mirror segments, if any, and switches the upgraded cluster to the original port and data directories. Run this command only during a downtime window. Disconnect all clients first: the command checks for active connections to the target cluster.

CAUTION

Once finalize starts, you cannot return the cluster to the original state. Before you run the command, check the upgraded cluster.

The command is interactive.

The command performs the following steps:

  1. Checks that there are no active connections to the target cluster.

  2. If the source cluster has mirror segments or a standby master, re-creates them from the upgraded primary segments and master.

  3. Switches the upgraded cluster to the original port and data directories.

  4. Archives the logs and stops the hub and agents.

  5. Applies the finalize data migration scripts.

  6. Asks whether to collect optimizer statistics. If you answer y, it analyzes the target cluster. If you answer n, run vacuumdb with the --all --analyze-in-stages options later.

The source data directories are kept under names with the upgrade ID and the .old suffix, for example, gpseg-1 is renamed to gpseg.<upgrade_id>.-1.old.

The finalize scripts re-create objects such as primary key and foreign key constraints that the initialize scripts dropped. If you skipped these scripts, apply them as described in Apply skipped data migration scripts.

To use the upgraded cluster, source the greengage_path.sh file from the target Greengage DB installation in a new shell.

Options: --verbose

revert

Returns the cluster to its original state. You can run it after initialize or execute, but not after finalize has started. In link mode, if the cluster does not have both a standby master and mirrors for all primary segments, you cannot revert after execute has started.

Run this command only during a downtime window. The command is interactive. Apply the revert scripts only if the initialize scripts were applied. Otherwise, the scripts fail because the objects that they re-create already exist.

The command performs the following steps:

  1. Checks that there are no active connections to the target cluster.

  2. Stops the target cluster and deletes its data directories.

  3. If execute has started in link mode, restores the data files of the master and the primary segments from the standby master and the mirror segments.

  4. Starts the source cluster.

  5. Archives the logs and stops the hub and agents.

  6. Applies the revert data migration scripts.

The revert scripts re-create the objects that the initialize scripts dropped. If you skipped these scripts and the initialize scripts were applied, apply the revert scripts as described in Apply skipped data migration scripts.

Options: --verbose

generate

Generates the data migration scripts for all databases in the source cluster. The scripts handle the database objects that require changes for the target version.

The scripts are generated for the objects that exist when you run generate. If you later create or change objects that cannot be upgraded, run generate again before you apply the initialize scripts.

You can apply the scripts from any directory with the apply command. If the scripts already exist, generate asks whether to archive them and generate new ones, use the existing scripts, or quit. No downtime is required.

Options: --gphome, --port, --seed-dir, --output-dir

apply

Applies the generated data migration scripts for the specified phase to the cluster. Use the scripts generated by the generate or initialize command.

The scripts can lock and rewrite tables and drop or re-create indexes and constraints. Apply them during a maintenance window when applications do not access the affected tables. The command asks which scripts to apply.

Options: --gphome, --port, --phase, --input-dir

config show

Shows the upgrade configuration parameters, including the target cluster’s data directory and port. Use it, for example, to connect to the target cluster before finalize.

Available from the start of initialize until finalize or revert completes. With a single option, the command shows only the value. Otherwise, it shows each parameter as <name>: <value>.

Options: --upgrade-id, --source-gphome, --target-gphome, --target-datadir, --target-port

restart-services

Restarts the hub and agents that are not running. Use it when a command fails because the hub is not running.

The hub stops when the terminal session that started it ends, so keep the session open until a command completes. The error also appears if you reconnect between commands.

Error: connecting to hub on port 7527: context deadline exceeded

After the restart, run the failed command again.

For details on the hub and agents, see Hub and agents.

version

Displays the utility version, like the -V option.

Options: --format

Configuration file

The file contains one <parameter> = <value> line per parameter. Comments start with # and can begin anywhere on a line. Empty lines are ignored. Each parameter can appear only once and must have a value.

The package includes a configuration file template. If you installed ggupgrade from the DEB package, the template is at /opt/greengagedb/ggupgrade/ggupgrade_config.

Example:

source_master_port = 5432
source_gphome = /opt/greengagedb/greengage6
target_gphome = /opt/greengagedb/greengage7
mode = copy

All other parameters use their default values.

source_master_port

(Required) The master port of the source cluster.

source_gphome

(Required) The installation directory for the source version of Greengage DB.

target_gphome

(Required) The installation directory for the target version of Greengage DB.

mode

(Optional) The upgrade mode.

Values: copy, link
Default: copy

disk_free_ratio

(Optional) The fraction of disk space that must be free on the file systems containing the source cluster’s data directories. The utility checks the free space during initialize. Specify 0 to skip the disk space check.

Values: from 0.0 to 1.0
Default: 0.6 for copy mode, 0.2 for link mode

pg_upgrade_jobs

(Optional) The number of parallel jobs for pg_upgrade (the --jobs option).

Default: 4

use_hba_hostnames

(Optional) Whether to use host names instead of IP addresses in the pg_hba.conf files of the target cluster.

Values: true, false
Default: false

dynamic_library_path

(Optional) Paths to append to the value of the dynamic_library_path parameter of the target cluster. Specify them for extensions installed outside their default location.

Default: $libdir

temp_port_range

(Optional) The ports for the target cluster during the upgrade. The range must contain enough free ports for the master, the standby, and all primary and mirror segments.

Values: a comma-separated list of ports and port ranges, for example, 6000,6002-6005
Default: 50432-65535

hub_port

(Optional) The hub port. For details, see Hub and agents.

Default: 7527

agent_port

(Optional) The agent port. For details, see Hub and agents.

Default: 6416

seed_dir

(Optional) The directory containing the seed scripts used to generate the data migration scripts. The seed scripts are included in the ggupgrade package. For DEB installations, this directory is /opt/greengagedb/ggupgrade/data-migration-scripts.

Default: the data-migration-scripts subdirectory in the utility’s installation directory

parent_backup_dirs

(Optional) The parent directories for backups of the master data directory. The backups are created in the .ggupgrade subdirectory of these directories on the master host and the segment hosts. By default, the parent directories of the data directories are used, for example, /data1/master for /data1/master/gpseg-1.

Set this parameter if the default directories cannot be created or do not have enough free space. Specify a single path, such as /data1/backup, to use it on all hosts, or <host1>:<dir1>,<host2>:<dir2>,…​ pairs, where the first host must be the master host and the list must include all segment hosts. gpadmin must have permission to create these directories. The utility creates and checks them during initialize, so any errors appear before the source cluster is stopped. The --parent-backup-dirs option for execute overrides this parameter.

Options

-f | --file <config_file>

Applies to: initialize

(Required) The configuration file that contains the upgrade parameters. See Configuration file for the format and parameters. This option can be combined only with --verbose, --pg-upgrade-verbose, and --seed-dir.

--parent-backup-dirs <directories>

Applies to: execute

(Optional) The parent directories for the upgrade backups. Overrides the parent_backup_dirs parameter in the configuration file. For the value format and the default directories, see the description of that parameter. The utility creates and checks the directories specified with --parent-backup-dirs only during execute, after the source cluster is stopped.

-v | --verbose

Applies to: initialize, execute, finalize, revert

(Optional) Print the output of the utilities that ggupgrade calls (gpstop, gpstart, pg_upgrade, and so on) and the duration of each step.

The output of these utilities can contain messages marked as errors or warnings even when a step succeeds, for example, while the standby is being created. Check the status of each step instead: [COMPLETE] or [FAILED].

--pg-upgrade-verbose

Applies to: initialize, execute

(Optional) Run pg_upgrade with the --verbose option. Requires --verbose.

--gphome <path>

Applies to: generate, apply

(Required) The path to the cluster’s Greengage DB installation. There is no default: the utility does not read the GPHOME environment variable.

--port <port>

Applies to: generate, apply

(Required) The master port of the Greengage DB cluster. There is no default: the utility does not read the PGPORT environment variable.

--seed-dir <directory>

Applies to: initialize, generate

(Optional) The directory with the seed scripts used to generate the data migration scripts. For initialize, this option overrides the seed_dir parameter in the configuration file. For the default directory, see the description of that parameter.

--output-dir <directory>

Applies to: generate

(Optional) The directory for the generated data migration SQL files. The default is $HOME/gpAdminLogs/ggupgrade/data-migration-scripts.

The scripts are written to the current subdirectory, grouped by phase. The initialize command always uses the default directory, regardless of this option. If you applied the initialize scripts from the directory set by --output-dir, apply the corresponding finalize or revert scripts from the same directory with the apply command.

--phase <phase>

Applies to: apply
Values: initialize, finalize, revert, stats

(Required) The data migration phase for which the scripts are applied.

The initialize, finalize, and revert scripts change the cluster. The stats scripts only collect cluster statistics, such as the number of segments, tables, and indexes.

--input-dir <directory>

Applies to: apply

(Optional) The directory containing the generated data migration SQL files. Specify the directory that contains the current subdirectory. The default is $HOME/gpAdminLogs/ggupgrade/data-migration-scripts.

--upgrade-id

Applies to: config show

(Optional) Show the upgrade identifier. The identifier is included in the names of the archived log directories and the .old source data directories.

--source-gphome

Applies to: config show

(Optional) Show the installation directory for the source version of Greengage DB.

--target-gphome

Applies to: config show

(Optional) Show the installation directory for the target version of Greengage DB.

--target-datadir

Applies to: config show

(Optional) Show the data directory of the target master.

--target-port

Applies to: config show

(Optional) Show the port of the target master.

-h | --help

Display help for the utility. If you specify a command before the option, display help for that command.

--format { multiline | oneline | json }

Applies to: version

(Optional) The format of the version information. The default is multiline. You can also use this option with -V.

-V | --version

Display the utility version.

Examples

Basic upgrade procedure

The following example upgrades a Greengage DB 6 cluster to Greengage DB 7 in copy mode. The utility generates and applies the data migration scripts itself. Run initialize in a shell without the Greengage DB environment loaded. For the complete procedure, including preparation and checks, see Upgrade a Greengage DB cluster.

  1. Create the configuration file ~/ggupgrade_config:

    source_master_port = 5432
    source_gphome = /opt/greengagedb/greengage6
    target_gphome = /opt/greengagedb/greengage7
    mode = copy
  2. Prepare the cluster for the upgrade:

    $ ggupgrade initialize --file ~/ggupgrade_config --verbose
  3. Upgrade the master and the primary segments:

    $ ggupgrade execute --verbose
  4. Check the upgraded cluster. To get the data directory and the port of the target cluster, run:

    $ ggupgrade config show --target-datadir --target-port
  5. Complete the upgrade:

    $ ggupgrade finalize --verbose

To return the cluster to its original state, run revert instead of finalize:

$ ggupgrade revert --verbose

Upgrade with manually applied scripts

Use this procedure to review the data migration scripts and apply the initialize scripts in advance, for example, during a separate maintenance window. Create the configuration file as in the basic procedure.

  1. Generate the scripts and review them in the ~/gpAdminLogs/ggupgrade/data-migration-scripts/current directory:

    $ ggupgrade generate --gphome /opt/greengagedb/greengage6 --port 5432
  2. Apply the initialize scripts to the source cluster. When the command asks which scripts to apply, select a (all):

    $ ggupgrade apply --gphome /opt/greengagedb/greengage6 --port 5432 \
      --phase initialize
  3. Prepare the cluster for the upgrade. When the command asks about the existing scripts, select c (continue). When it asks which initialize scripts to apply, select n (none), because you have already applied them:

    $ ggupgrade initialize --file ~/ggupgrade_config --verbose
  4. Upgrade the master and the primary segments:

    $ ggupgrade execute --verbose
  5. Check the upgraded cluster. To get the data directory and the port of the target cluster, run:

    $ ggupgrade config show --target-datadir --target-port
  6. Complete the upgrade:

    $ ggupgrade finalize --verbose

If you skipped the migration scripts when running the finalize command, apply them as described in Apply skipped data migration scripts.

Generate the data migration scripts

Run generate in advance, for example, to review the scripts before initialize applies them or to see which objects the upgrade changes:

$ ggupgrade generate --gphome /opt/greengagedb/greengage6 --port 5432

Write the scripts to a custom directory, for example, to apply them later with the apply command (see --output-dir):

$ ggupgrade generate --gphome /opt/greengagedb/greengage6 --port 5432 \
  --output-dir ~/migration_scripts

Apply skipped data migration scripts

If you skipped the finalize or revert scripts, apply them after the command completes. Specify the installation directory for the version of Greengage DB that is running now and the original port. For the input directory, use the script directory in the upgrade log archive. The utility shows this path, which is unique for each upgrade, in its instructions for the next steps. For example, to apply the finalize scripts to the upgraded cluster:

$ ggupgrade apply \
  --gphome /opt/greengagedb/greengage7 \
  --port 5432 \
  --phase finalize \
  --input-dir ~/gpAdminLogs/ggupgrade-XJES4G9-fOA-20261019T123609/data-migration-scripts

To apply the skipped revert scripts, specify --phase revert and the installation directory of the source version of Greengage DB.

Recover from an interrupted execute

If the hub stops during execute, for example, because the terminal session closes, postgres processes of the source cluster started by pg_upgrade can remain on the cluster hosts. In this case, rerunning execute fails with a connection refused error, and revert cannot start the source cluster.

To return the cluster to its original state:

  1. Restart the hub and agents:

    $ ggupgrade restart-services
  2. On each cluster host, find the postgres processes of the source cluster left by pg_upgrade. You can identify them by the -b option in the command line:

    $ ps -ef | grep '[p]ostgres -D' | grep -- ' -b '
  3. Stop each such process, specifying its data directory from the -D option value, for example:

    $ /opt/greengagedb/greengage6/bin/pg_ctl stop -D /data1/primary/gpseg0 -m fast
  4. Return the cluster to its original state:

    $ ggupgrade revert --verbose

Show the upgrade configuration

Show all configuration parameters:

$ ggupgrade config show

Show only the target cluster’s data directory and port:

$ ggupgrade config show --target-datadir --target-port

Change the location of the upgrade backups

If the file systems containing the data directories do not have enough free space, specify other directories for the upgrade backups. For the value format and the directory requirements, see the parent_backup_dirs parameter in the configuration file.

Store the backups in the /data1/backup directory on the master host and on the segment hosts:

$ ggupgrade execute --parent-backup-dirs /data1/backup

If the hosts have different disk layouts, specify a directory for each host:

$ ggupgrade execute \
  --parent-backup-dirs mdw:/data1/backup,sdw1:/data2/backup,sdw2:/data2/backup

Print the detailed output of pg_upgrade

If a pg_upgrade check or an upgrade step fails, run the command again with the --pg-upgrade-verbose option to print the internal output of pg_upgrade. For example:

$ ggupgrade initialize --file ~/ggupgrade_config \
  --verbose --pg-upgrade-verbose

Display help

To see a command’s description, steps, and options, run it with the --help option:

$ ggupgrade initialize --help

To see the list of commands, run the utility with the same option:

$ ggupgrade --help

See also