How do I restore my data?

Member for

4 years 5 months
Submitted by ehu on Mon, 05/13/2013 - 13:04

Assuming you have created a backup file using setup.pl, you can restore your database using the command:

 $ pg_restore [options] your_backup.bak

It should be pointed out that it's not possible to restore a backup to a database with a different name than the one you made the backup from!

If the database to restore into doesn't exist: replace [options] with -C new_database.
If you want to restore replacing 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
Topic