How do I restore my data?

Assuming you have created a backup file using or the following command on the command line (which is the command line equivalent of what does):

 $ pg_dump -F c -f your_backup.bak your_company_database


You can restore your database using the command:

 $ pg_restore [options] your_backup.bak

If you want to restore into a new database, replace [options] with -C new_database. If you want to restore and replace an existing database, replace [options] with --clean -C new_database.

Note: You need to restore the roles backup before restoring the data backup.

FAQ Category: