Other methods for moving a geodatabase in PostgreSQL
You can move individual PostgreSQL databases using the pg_dump command, or use the pg_dumpall command to move all databases on a PostgreSQL instance plus users and permissions.
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 instance. If you extract to a SQL script, run the SQL script on the new server to rebuild the database. The pg_dumpall command can only extract to a SQL script, then restore to another PostgreSQL instance by running the SQL script.
The following are some guidelines for moving PostgreSQL databases with pg_dump or pg_dumpall:
- 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.
- Because pg_dumpall reconnects to the PostgreSQL server for each database, it prompts you for a password each time (if you are using password authentication).
- Connect as a superuser to run pg_dump or pg_dumpall successfully.
For specific information on how to use pg_dump, pg_dumpall, or pg_restore, consult the PostgreSQL documentation.