Updated on 2025-05-29 GMT+08:00

Instance-level Import and Export

gs_dumpall can be used to logically back up database instances and export data of all databases in an instance, including data in the default database, data in user-defined databases, and definitions of global objects shared by all databases.

For details about how to use the gs_dumpall tool, see "Data Import and Export Tools > gs_dumpall for Exporting All Database Information" in Tool Reference.

  • gs_dumpall does not back up parameters for running databases.
  • gs_dumpall supports only plain-text format export. Therefore, only gsql can be used to restore a file exported using gs_dumpall.
  • After restoration, you are advised to run ANALYZE on each database to provide useful statistics for the optimizer.
During backup, you are advised to run the following commands as the initial user or a user with SYSADMIN permissions:
nohup gs_dumpall -U root -W ******** -f /data/backup/bkp2.sql -p 8000 > /data/backup/dumpall_backup.log &
During restoration, you are advised to run the following commands as the initial user:
nohup gsql -d postgres -p 8000 -U root -W ******** -f /data/backup/bkp2.sql -a > /data/backup/dumpall_restore.log &