1. Knowledge Base
  2. Admin
  3. Database Administration

Backing Up the Database

This article attempts to provide information for both experienced and novice users alike. If the command line is your preference, we have command line examples for you to follow. 

Command line examples (all platforms):

Info: The following examples all use the user name "admin". This is the default name created when installing the xTuple ERP software starting with version 3. Earlier versions used the user name "mfgadmin" as the default user and it is possible that the databases can be configured with a different name. You should use the appropriate privileged username in place of "admin" for your system.

If logged in to the server running Postgres as a user with the correct permissions, and Postgres runs on default port of 5432:

pg_dump -U admin databasename > backupname.sql

This will create a backup of databasename called backupname.sql

If Postgres is running on a port other than 5432:

pg_dump -U admin -p 5433 databasename > backupname.sql

If you are running pg_dump from a remote client:

pg_dump -U admin -h mypgserver.mydomain.com -p 5433 databasename > backupname.sql

See also documentation related to installing the database and restoring the database.

More on Business Continuity.