This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
how_to:database_maintenance [2011/03/08 18:03] – [Rebuilding Indexes] paul | how_to:database_maintenance [2018/11/14 10:45] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 9: | Line 9: | ||
(Doing a ' | (Doing a ' | ||
+ | |||
+ | =====Differences between versions of VPOP3===== | ||
+ | VPOP3 versions 3 and 4 installed PostgreSQL on the default port of 5432. In version 5 this was changed so that it will now find the first free port AFTER 5432, this was to avoid conflicts with other installations of PostgreSQL on the same computer. Usually this means that for version 5 PostgreSQL will be on port 5433 (but it may be a higher number, if other software is using port 5433). | ||
+ | |||
+ | You can tell which port VPOP3 is using by going to the **Settings -> Database -> Connection** page in the VPOP3 settings, and look at the **PostgreSQL Port** setting. If VPOP3 isn't running, then you can view the ' | ||
+ | |||
+ | You need to specify the port number in all PostgreSQL commands, as '-p < | ||
=====Freeing disk space===== | =====Freeing disk space===== | ||
In exceptional circumstances you may want to reduce the size of the database files created by the database system. Normally this is not recommended, | In exceptional circumstances you may want to reduce the size of the database files created by the database system. Normally this is not recommended, | ||
- | The main program you should use for decreasing | + | Usually |
+ | |||
+ | ====Steps for backup/ | ||
+ | (These instructions are for VPOP3 v5 or later) | ||
+ | |||
+ | * Stop the VPOP3 service, //not// the VPOP3DB service | ||
+ | * Go to a command prompt | ||
+ | * Backup the database to a file, eg ' | ||
+ | * Make sure there were no errors reported during the backup! | ||
+ | * Remove the old database using **pgsql\bin\dropdb | ||
+ | * Restore the database backup using, eg: **pgsql\bin\pg_restore -v -j 4 -U postgres -p 5433 -C -d postgres database.dmp** | ||
+ | * Restart the VPOP3 service | ||
+ | |||
+ | If asked for a password, the default password | ||
+ | |||
+ | For further information, see the PostgreSQL documentation: | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
- | If you are very short of free disk space, then you can use the ' | + | ====Alternative |
+ | If you are very short of free disk space, then you can use the ' | ||
=====Rebuilding Indexes===== | =====Rebuilding Indexes===== | ||
If you suspect that indexes have become damaged, then you can reindex the database. Again, this requires VPOP3 to be stopped first. | If you suspect that indexes have become damaged, then you can reindex the database. Again, this requires VPOP3 to be stopped first. | ||
- | Go to the VPOP3\pgsql\bin folder in a Windows command prompt. Then run **reindexdb -U vpop3 vpop3**. The default password is **vpop3pass**. This operation may take a while, and require some free disk space. | + | Go to the VPOP3\pgsql\bin folder in a Windows command prompt. Then run **reindexdb -U vpop3 -p < |