HOW TO
In certain instances, Esri Support Services may request a backup of a PostgreSQL database or geodatabase. This article outlines the required processes for backing up a PostgreSQL database to share with Esri Support.
While there can be multiple ways of backing up a database, there are specific supported processes for backing up these databases for use and successful restoration by Esri support.
Note: There is a video outlining the PostgreSQL (geo)database backup processes in this article available online: How To Backup a PostgreSQL (geo)database for Esri Support Services
Prerequisites:
Gathering important information about your PostgreSQL Environment:
C:\Windows\system32>cd C:\Program Files\PostgreSQL\11\bin
C:\Program Files\PostgreSQL\11\bin>psql -U postgres
The script below gathers information about your database and database cluster that aids in the restoration of your database.
\o EsriBackupInfo.txt \\ --Sets the name of the output file for the results of our psql commands. SELECT version(); \\ --Returns the version of PostgreSQL. \l+ \\ --Lists the databases in the cluster along with necessary information regarding their configuration \c <DatabaseName> \\ --Connects us to the database we are preparing to backup Replace <DatabaseName> with the actual name of your database (IE: \c backmeup). show search_path; \\ --Lists the search path configured in the database we are connected to. select description from sde.sde_version; \\ --Returns the version of the geodatabase. \du+ \\ -- Lists the logins/roles in the database, including their attributes and memberships. \dn+ \\ --Lists the schemas, their owners, and access privileges. \db+ \\ --Lists the tablespaces and their sizes. \q \\ --Quits psql command line.
Backing up the database:
pg_dump -U <superuser> -p <port> -Fc -v -d <DatabaseName> -f "<PathToWriteBackupFileTo>"
Replace:
For information regarding the command line options used with pg_dump, please refer to the PostgreSQL pg_dump documentation.
C:\Program Files\PostgreSQL\11\bin>pg_dump -U postgres -p 5432 -Fc -v -d backmeup -f "C:\PG_Backups\backmeup.dmp"
Provide your files to Esri Support:
Once the backup has been completed successfully, follow these steps:
Article ID: 000026422
Get help from ArcGIS experts
Download the Esri Support App