Export and Import Dump without Binary Data
Create Dump
pg_dump
To export the database in PostgreSQL, execute the following command:
pg_dump -U <codebeamer_database_user> <codebeamer_database_name> > codebeamer_dump.sql
If the postgresql server runs on a different machine, the pg_dump can be configured with host and port values of the database server. For example:
pg_dump -U <codebeamer_database_user> -h <postgresql_server_host> -p <postgresql_server_port> <codebeamer_database_name> > codebeamer_dump.sql
Exporting Dump Without Binary Data
If the binary data is stored in the database, then exporting database without binary data is recommended:
pg_dump -U <codebeamer_database_user> -B --exclude-table-data=*_blobs <codebeamer_database_name> > codebeamer_dump.sql
If the postgresql server runs on a different machine
pg_dump -U <codebeamer_database_user> -h <postgresql_server_host> -p <postgresql_server_port> -B --exclude-table-data=*_blobs <codebeamer_database_name> > codebeamer_dump.sql
The pg_dump command produces a codebeamer_dump.sql file which can be compressed with zip, tar or tar.gz.
For more information about this tool, see https://www.postgresql.org/docs/9.1/backup-dump.html
Import Dump
To import the exported postgresql dump, use the following psql command:
psql -U <codebeamer_database_user> <codebeamer_database_name> < codebeamer_dump.sql
If the postgresql server runs on a different machine, the command can be configured with database host and port values of the database server:
psql -U <codebeamer_database_user> -h <postgresql_server_host> -p <postgresql_server_port> <codebeamer_database_name> < codebeamer_dump.sql
Was this helpful?