User Tools

Site Tools


how_to:restore_a_backup_of_vpop3

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
how_to:restore_a_backup_of_vpop3 [2011/07/25 10:11] paulhow_to:restore_a_backup_of_vpop3 [2018/11/14 10:45] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ======How to Restore a backup of VPOP3====== ======How to Restore a backup of VPOP3======
-=====Version or later=====+The instructions below are to restore a full backup. You may also be able to [[recover deleted messages]] if you do not need to restore a full backup. 
 + 
 +=====Version or later===== 
 +If you just need to restore a database backup, see steps 4 to 7 below. 
 + 
 +To restore a [[backup_vpop3|full backup of VPOP3]],  
 +  - If VPOP3 is already installed, make sure VPOP3 is shut down before starting the restore process 
 +  - Restore the files you made when you [[backup VPOP3|backed up VPOP3]] - do //NOT// restore anything in the **VPOP3\pgsql** folder tree 
 +  - Reinstall VPOP3 into the location where you restored VPOP3. This should reinstall the PostgreSQL database system. //Do not start VPOP3 at this time// 
 +  - 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 <port number> vpop3**. When it prompts for the password enter the PostgreSQL master password - default **pgsqlpass**. (<port number> is usually 5433) 
 +  - Run **pgsql\bin\pg_restore -U postgres -p <port number> -v -C -d postgres DBBACK-<number>.DMP** where <number> is the latest number of the database backup made by VPOP3 (check the file timestamps). When it prompts for a password enter the PostgreSQL master password - default **pgsqlpass**. (<port number> is usually 5433). Note that during this step you may see a couple of errors which are not important: there may be an error about the database already existing, and also an error that the 'plpgsql' language is already installed. (Each of these errors may have several lines in the output). If there are lots of errors, then there may be a problem and you should contact support@pscs.co.uk. 
 +  - Start VPOP3 
 + 
 +=====Version 3 or 4=====
 If you just need to restore a database backup, see steps 4 to 6 below. If you just need to restore a database backup, see steps 4 to 6 below.
  
Line 10: Line 24:
   - 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. To do this, run **pgsql\bin\dropdb -U postgres vpop3**. When it prompts for the password enter the PostgreSQL master password - default **pgsqlpass**.    - 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**. 
-  - Run **pgsql\bin\pg_restore -U postgres -C -d postgres 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**+  - Run **pgsql\bin\pg_restore -U postgres -C -d postgres 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**. Note that during this step you may see a couple of errors which are not important: there may be an error about the database already existing, and also an error that the 'plpgsql' language is already installed. (Each of these errors may have several lines in the output). If there are lots of errors, then there may be a problem and you should contact support@pscs.co.uk.
   - Start VPOP3   - Start VPOP3
  
-You may also want to [[Restore folder V3|Restore single user's mailbox or mail folder]]+====Increasing restore performance==== 
 +When restoring the database backup it may take a very long time (depending on system performance, and the size of the backup). There are some changes you can make to the PostgreSQL configuration before doing the restore to make it quicker. These changes make normal PostgreSQL operation less 'safe', so should be reverted after the restore has completed. It is OK during restore, because if there is a power failure during restore, you will want to start the restore again anyway. If you leave these settings in during normal operation, then power failure will almost certainly mean the database is corrupted and will need manually restoring!
  
-=====Version 2.6 or earlier===== +Do not do this if the PostgreSQL server is used for other things as well! 
-To restore a backup of VPOP3 + 
-  - If VPOP3 is already installedmake sure VPOP3 is shut down before starting the restore process +In the **VPOP3\pgsql\data** folder: 
-  - Restore the files you made when you [[backup VPOP3|backed up VPOP3]] +  - copy the ''postgresql.conf'' file to ''postgresql.conf.normal'' 
-  - Restore the registry backup you made as well by double-clicking on the .REG file you made +  - edit the ''postgresql.conf'' file in Notepad 
-  - Reinstall VPOP3 into the location where you restored VPOP3. +  - add the following to the bottom of the file: <code> 
 +fsync off 
 +maintenance_work_mem 128MB 
 +full_page_writes off 
 +wal_buffers 16MB 
 +checkpoint_segments 16</code> 
 +  - save the file (as 'postgresql.conf' in the VPOP3\pgsql\data folder) 
 +  - restart the 'VPOP3DB' (or 'PostgreSQL-VPOP3'or 'PostgreSQL') service 
 +  - run the restore procedure 
 +  - rename the ''postgresql.conf' file to 'postgresql.conf.restore'' 
 +  - copy the ''postgresql.conf.normal'' file back to ''postgresql.conf'' 
 +  - restart The'VPOP3DB' (or 'PostgreSQL-VPOP3', or 'PostgreSQL') service 
 + 
 +====Related articles==== 
 + 
 +  - [[https://support.pscs.co.uk/staff/index.php?/Knowledgebase/Article/Edit/38|Restore backup on Version 2.6 or earlier]]
  
 {{tag>restore backup}} {{tag>restore backup}}
how_to/restore_a_backup_of_vpop3.1311585099.txt.gz · Last modified: 2018/11/14 10:44 (external edit)