User Tools

Site Tools


how_to:total_rebuild_of_database

Total Rebuild of Database

If you suspect database corruption, sometimes the best thing to do is to totally rebuild the database. This involves six steps:

  1. Stop VPOP3
  2. Backup Database
  3. Delete Database
  4. Re-create Database
  5. Restore/Create Database
  6. Restart VPOP3

The process may take 5-10 minutes, or more depending on the size of your database. If you want to check how long it will take before you start, then manually backup the database first. The full procedure will take approximately 3 or 4 as long as the database backup.

We have made a simple batch file to do this procedure for you. Download it and extract it into the main VPOP3 directory. Then, go to a command prompt in the VPOP3 directory and type 'rebuilddb'. It will ask for confirmation between each command in case problems occur.

You MAY get an error like this one - this can be ignored. It simply means that the restore was trying to create something which already existed.

pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 804; 2612 16386 PROCEDURAL LANGUAGE plpgsql postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  language "plpgsql" already exists
    Command was: CREATE PROCEDURAL LANGUAGE plpgsql;
how_to/total_rebuild_of_database.txt · Last modified: 2018/11/14 10:45 (external edit)