This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
how_to:backup_vpop3 [2012/04/19 08:30] – [Manual Database Backup] paul | how_to:backup_vpop3 [2018/11/14 10:45] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
======How to Backup VPOP3====== | ======How to Backup VPOP3====== | ||
- | =====VPOP3 version 5===== | + | |
- | To backup VPOP3 version 5 you should: | + | By default VPOP3 v3 and later will automatically perform a daily backup of the database into a file called DBBACK-x.DMP, |
+ | |||
+ | In VPOP3 v5 and later, this database backup is a full backup of VPOP3. In VPOP3 v3 & v4, it is a partial backup, so you need to backup other files/data as well. | ||
+ | |||
+ | See our " | ||
+ | =====VPOP3 version 5 and later===== | ||
+ | To backup VPOP3 version 5 and later you should: | ||
* Backup the VPOP3 directory and subdirectories, | * Backup the VPOP3 directory and subdirectories, | ||
Line 13: | Line 19: | ||
- Go to a command prompt on the VPOP3 computer, and go to the VPOP3 directory. | - Go to a command prompt on the VPOP3 computer, and go to the VPOP3 directory. | ||
- | - Run **pgsql\bin\pg_dump -p <port number> -F c -U vpop3 -f database.dmp vpop3** ('< | + | - Run '' |
- | - At the password prompt, type vpop3pass (This assumes a standard installation, | + | - At the password prompt, type '' |
This will create a file ' | This will create a file ' | ||
+ | ===Task Scheduler=== | ||
+ | If you wish, you could create a task in Windows Task Scheduler to do this according to your own schedule. | ||
+ | |||
+ | If you are going to script the backup process, you need to automate the password. There is no command-line parameter to do this. You can either set the environment variable PGPASSWORD before running the pg_dump program, or create a [[http:// | ||
+ | |||
+ | An example .CMD file is below - you may need to edit paths in this file before using it, and test it thoroughly in your situation before relying on it for your backups | ||
+ | |||
+ | < | ||
+ | SET VPOP3PATH=c: | ||
+ | SET BACKUPPATH=c: | ||
+ | |||
+ | SET PGDUMPPATH=%VPOP3PATH%\pgsql\bin\pg_dump.exe | ||
+ | SET PGPASSWORD=vpop3pass | ||
+ | " | ||
+ | if errorlevel 1 goto error | ||
+ | move " | ||
+ | goto end | ||
+ | :error | ||
+ | REM Can log/report errors here | ||
+ | :end | ||
+ | SET PGPASSWORD=</ | ||
====Alternative Backup Procedures==== | ====Alternative Backup Procedures==== | ||
+ | ===Replication/ | ||
VPOP3 version 5 uses PostgreSQL 9.1, and stores all settings/ | VPOP3 version 5 uses PostgreSQL 9.1, and stores all settings/ | ||
Line 24: | Line 52: | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
There will generally be a minute or less of downtime to do this, as, apart from the reconfiguration of the master PostgreSQL server, the rest of the process can be performed with the master PostgreSQL server running and operating normally. | There will generally be a minute or less of downtime to do this, as, apart from the reconfiguration of the master PostgreSQL server, the rest of the process can be performed with the master PostgreSQL server running and operating normally. | ||
- | (We can help set this up for you if you wish, but this will be chargeable - the current rate is £40 + VAT for a simple setup (ie replicating over a LAN with file sharing available between the two PCs). If you have a more complicated setup (eg replicating over the Internet) this can be more complex as it can involve configuring VPNs etc, so the cost may be greater) | + | See the [[PostgreSQL replication]] article for more details |
+ | |||
+ | (We can help set this up for you if you wish, but this will be chargeable - the current rate is £100 + VAT for a simple setup (ie replicating over a LAN with file sharing available between the two PCs). If you have a more complicated setup (eg replicating over the Internet) this can be more complex as it can involve configuring VPNs etc, so the cost may be greater) | ||
+ | |||
+ | ===Backing up the PostgreSQL database directly=== | ||
+ | If you are using backup software which supports VSS (Volume Snapshot Service), then you can backup the entire VPOP3 directory including the pgsql\data folder. If you do this, then upon a restore, the database service will react as if there was a power failure, and perform the recovery procedure to bring the database back to a live state. **Only** do this if you are certain that your backup software supports VSS. If you backup the pgsql\data folder without using VSS, then the backup will almost certainly be unusable as the various database files will have been copied at different times, and thus will be inconsistent. | ||
+ | |||
+ | Note that here, we prefer backing up the DMP backup files, but some people have used the VSS backup system and no problems have been reported. | ||
+ | ([[http:// | ||
+ | |||
+ | You could backup both the DMP files and use a VSS backup as well. The VSS backup method will allow better incremental backups, and faster recovery, while the DMP files will give an alternative backup in case of issues. | ||
+ | |||
=====VPOP3 version 3 or 4===== | =====VPOP3 version 3 or 4===== | ||
To backup VPOP3 version 3 or 4 you should: | To backup VPOP3 version 3 or 4 you should: | ||
* Backup the VPOP3 directory and subdirectories, | * Backup the VPOP3 directory and subdirectories, | ||
- | * Backup the VPOP3 windows registry settings. These are at **HKEY_LOCAL_MACHINE\SOFTWARE\PaulSmith\VPOP3**. You can either export these manually from RegEdit, or run "regedit /e vpop3.reg HKEY_Local_Machine\Software\PaulSmith\VPOP3" | + | * Backup the VPOP3 windows registry settings. These are at **HKEY_LOCAL_MACHINE\SOFTWARE\PaulSmith\VPOP3**. You can either export these manually from RegEdit, or run '' |
====Manual Database Backup==== | ====Manual Database Backup==== | ||
Line 37: | Line 79: | ||
- Go to a command prompt on the VPOP3 computer, and go to the VPOP3 directory. | - Go to a command prompt on the VPOP3 computer, and go to the VPOP3 directory. | ||
- | - Run **pgsql\bin\pg_dump -F c -U vpop3 -f database.dmp** | + | - Run '' |
- | - At the password prompt, type vpop3pass (This assumes a standard installation, | + | - At the password prompt, type '' |
This will create a file ' | This will create a file ' | ||
Line 46: | Line 88: | ||
To backup earlier versions of VPOP3 you should: | To backup earlier versions of VPOP3 you should: | ||
* Backup the VPOP3 directory and all subdirectories | * Backup the VPOP3 directory and all subdirectories | ||
- | * Backup the VPOP3 windows registry settings. These are at **HKEY_LOCAL_MACHINE\SOFTWARE\PaulSmith\VPOP3**. You can either export these manually from RegEdit, or run "regedit /e vpop3.reg HKEY_Local_Machine\Software\PaulSmith\VPOP3" | + | * Backup the VPOP3 windows registry settings. These are at '' |
{{tag> | {{tag> |