If you cannot use an existing Postgres or vPostgres database from vFabric Postgres or vFabric Postgres for Data Director, you can dump the database and import or restore it.

You might not be able to use a Postgres database from vFabric Postgres or vFabric Postgres for Data Director, a database created from vFabric Postgres in Data Director, or a database created in Data Director from the standalone version of vFabric Postgres. You might also have problems if a new major version of vFabric Postgres has been released.

If this happens, you can export the database to text format by using either the pg_dumpall or the pg_dump utility, as follows.

pg_dumpall

Dumps every object for all databases. You can load the resulting dump into the vFabric Postgres appliance or a virtual machine on which the vFabric Postgres RPMs have been installed with the psql command. You cannot use this command with vFabric Postgres for Data Director.

pg_dump

Supports a granular dump based on schemas or tables and includes a custom format. You can load into all versions of vFabric Postgres.

1

Decide whether you want to use pg_dumpall or pg_dump.

2

Use each command with the correct corresponding restore option.

pg_dumpall > mydump.sql
psql -d postgres -f mydump.sql
pg_dump -Fc -d mydb > mydbdump.dmp
dropdb mydb
pg_restore -C -d postgres mydbdump.dmp