If you want to move the contents of one geodatabase to another database on the same PostgreSQL database cluster, you can create a second geodatabase and move the data. If you want to move the geodatabase to a new PostgreSQL database cluster, you can use PostgreSQL commands to move the database.
Move data to another geodatabase on the same PostgreSQL database cluster
Database and geodatabase names must be unique on the same PostgreSQL database cluster; therefore, if you want to move your data to a different geodatabase on the same database cluster, create a second geodatabase on the database cluster and move your existing data to the new geodatabase. You can move the data in ArcGIS by copying and pasting, using the Export tool, using the Extract Data wizard, or using XML workspace documents.
Be aware that the user logged in when loading the data to the new geodatabase will own the data. If you want the data to have the same owner in the new geodatabase, have each user move his or her own data.
Move a database to a new PostgreSQL database cluster
If you want to move a geodatabase to a new PostgreSQL database cluster, you can use the pg_dump command.
The pg_dump command can extract the database definition (schema) and data or just the database schema to a Structured Query Language (SQL) script or an archive file. If you extract to an archive file, you can use the pg_restore command to rebuild the database on another PostgreSQL cluster. If you extract to an SQL script, run the SQL script on the new server to rebuild the database.
The following are some guidelines for moving PostgreSQL databases with pg_dump:
- You must first restore the public schema, and then restore the rest of the database when moving a geodatabase in PostgreSQL. See Restore a geodatabase to PostgreSQL for more information.
- If you use object identifiers (OIDs) in your user-defined data, be sure to specify the –o option to include the OIDs in the dump.
- Tablespaces must be re-created.
- If you output to TAR archives, the text version of any individual table cannot be larger than 8 GB.
- After rebuilding the databases, run ANALYZE to update database statistics.
- Connect as a superuser to run pg_dump.
For specific information on how to use pg_dump or pg_restore, see the PostgreSQL documentation.