User Tools

Site Tools


how_to:restore_a_database_backup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
how_to:restore_a_database_backup [2011/05/05 11:17] – password in bold for clarity simonhow_to:restore_a_database_backup [2013/05/08 11:06] paul
Line 2: Line 2:
 If you have a valid backup of the PostgreSQL database used by VPOP3, you can restore it by performing the following steps: If you have a valid backup of the PostgreSQL database used by VPOP3, you can restore it by performing the following steps:
  
 +=====VPOP3 v5 or later=====
 +  - Open a command prompt, and go to the VPOP3 directory
 +  - If you are restoring the backup over an existing VPOP3 database (especially if the database files are damaged) you will need to DROP the database first. 
 +    - To do this, run pgsql\bin\dropdb -U postgres -p 5433 vpop3. When it prompts for the password enter the PostgreSQL master password - default **pgsqlpass**.
 +  - Run pgsql\bin\pg_restore -U postgres -C -p 5433 -v -j 4 -d postgres <filename> where <filename> is the database backup you want to restore. When it prompts for a password enter the PostgreSQL master password - default **pgsqlpass**
  
 +=====VPOP3 v3 or v4=====
   - Open a command prompt, and go to the VPOP3 directory   - Open a command prompt, and go to the VPOP3 directory
   - If you are restoring the backup over an existing VPOP3 database (especially if the database files are damaged) you will need to DROP the database first.    - If you are restoring the backup over an existing VPOP3 database (especially if the database files are damaged) you will need to DROP the database first. 
     - To do this, run pgsql\bin\dropdb -U postgres vpop3. When it prompts for the password enter the PostgreSQL master password - default **pgsqlpass**.     - To do this, run pgsql\bin\dropdb -U postgres vpop3. When it prompts for the password enter the PostgreSQL master password - default **pgsqlpass**.
-    - Then you will need to recreate the database - run pgsql\bin\createdb -E SQL_ASCII -O vpop3 -U postgres vpop3 +  - Run pgsql\bin\pg_restore -U postgres -C -v -d postgres <filename> where <filename> is the database backup you want to restore. When it prompts for a password enter the PostgreSQL master password - default **pgsqlpass**
-  - Run pgsql\bin\pg_restore -U postgres -C -d vpop3 DBBACK-<number>.DMP where <number> is the latest number of the database backup made by VPOP3. When it prompts for a password enter the PostgreSQL master password - default **pgsqlpass**+
  
how_to/restore_a_database_backup.txt · Last modified: 2023/09/06 11:09 by paul