User Tools

Site Tools


how_to:backup_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:backup_vpop3 [2013/10/08 09:48] – [VPOP3 version 5] paulhow_to:backup_vpop3 [2018/11/14 10:45] (current) – external edit 127.0.0.1
Line 19: 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'' ('<port number>' is usually 5433)+  - Run ''pgsql\bin\pg_dump -p <port number> -F c -U vpop3 -f database.dmp vpop3'' ('<port number>' is usually 5433)\\ e.g. //pgsql\bin\pg_dump -p 5433 -F c -U vpop3 -f database.dmp vpop3//
   - At the password prompt, type ''vpop3pass'' (This assumes a standard installation, if your PostgreSQL installation is non-standard, then you may need to change this command appropriately)   - At the password prompt, type ''vpop3pass'' (This assumes a standard installation, if your PostgreSQL installation is non-standard, then you may need to change this command appropriately)
  
 This will create a file 'database.dmp' containing a backup of the database at the current state in the VPOP3 directory. This will create a file 'database.dmp' containing a backup of the database at the current state in the VPOP3 directory.
  
 +===Task Scheduler===
 If you wish, you could create a task in Windows Task Scheduler to do this according to your own schedule. 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://www.postgresql.org/docs/9.1/static/libpq-pgpass.html|pgpass.conf]] file. 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://www.postgresql.org/docs/9.1/static/libpq-pgpass.html|pgpass.conf]] file.
 +
 +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
 +
 +<code>REM edit the paths in the following lines if necessary
 +SET VPOP3PATH=c:\vpop3
 +SET BACKUPPATH=c:\vpop3
 +
 +SET PGDUMPPATH=%VPOP3PATH%\pgsql\bin\pg_dump.exe
 +SET PGPASSWORD=vpop3pass
 +"%PGDUMPPATH%" -F c -v -h 127.0.0.1 -p 5433 -U vpop3 -f "%BACKUPPATH%\DBBack.tmp" vpop3
 +if errorlevel 1 goto error
 +move "%BACKUPPATH%\dbback.tmp" "%BACKUPPATH%\dbback.dmp"
 +goto end
 +:error
 +REM Can log/report errors here
 +:end
 +SET PGPASSWORD=</code>
 ====Alternative Backup Procedures==== ====Alternative Backup Procedures====
 ===Replication/point-in-time recovery/incremental backups=== ===Replication/point-in-time recovery/incremental backups===
Line 41: Line 59:
 See the [[PostgreSQL replication]] article for more details 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 £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)+(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=== ===Backing up the PostgreSQL database directly===
Line 61: 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 vpop3''+  - Run ''pgsql\bin\pg_dump -F c -U vpop3 -v -f database.dmp vpop3''
   - At the password prompt, type ''vpop3pass'' (This assumes a standard installation, if your PostgreSQL installation is non-standard, then you may need to change this command appropriately)   - At the password prompt, type ''vpop3pass'' (This assumes a standard installation, if your PostgreSQL installation is non-standard, then you may need to change this command appropriately)
  
how_to/backup_vpop3.1381222138.txt.gz · Last modified: 2018/11/14 10:44 (external edit)