Next: Year End Closing
Up: File Management
Previous: Backing Up Your Database
Restoring the Database
Restoring the database is a fairly simple process. First, be sure you have a recent backup file. (Assume
the name of your database is, ``mydbname'' and the name of your backup file is, ``mybackupname'').
Follow these steps to restore the database file from your backup file.
- Go to the terminal command line and change into the directory containing your backup file (if
you aren't already located there).
- Delete the old database. Enter the command, -> ``dropdb mydbname''.
- Create a new, empty database. Enter the command, -> ``createdb mydbname''.
- Restore the backup data to the empty data base. Enter the command, -> ``cat mybackupname |
psql mydbname''
The new database will now contain all the data from your backup file. For more details on backing up
and restoring a database see the Postgres documentation.
Don Anderson
2006-12-21