This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
how_to:postgresql_server_won_t_start_due_to_damaged_log_files [2010/08/06 10:16] – created paul | how_to:postgresql_server_won_t_start_due_to_damaged_log_files [2015/09/23 13:46] – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
======PostgreSQL server won't start due to damaged log files====== | ======PostgreSQL server won't start due to damaged log files====== | ||
- | If the PostgreSQL server won't start at all, because its transaction logs are damaged, you will need to recreate the database store totally. | + | If the PostgreSQL server won't start at all, because its transaction logs are damaged, you will probably |
+ | |||
+ | To rebuild the database: | ||
+ | - Open a command prompt and find the VPOP\pgsql folder | ||
+ | - Rename the **data** folder to **data_old** | ||
+ | - Run < | ||
+ | - When it prompts for a password, type in the password you want for the PostgreSQL superuser - we use **pgsqlpass**. If you choose to use something different, make sure you remember what it is! | ||
+ | - Type < | ||
+ | - Set the permissions on the new Data folder. In Windows Explorer, right-click the VPOP3\pgsql\DATA folder and choose ' | ||
+ | - Start the PostgreSQL service in Windows | ||
+ | - From the command prompt in vpop3\pgsql\bin run < | ||
+ | - [[restore a backup of VPOP3|Restore the latest good database backup]] | ||
+ | |||
+ | Once you're happy everything is working OK, you can delete the **data_old** folder. | ||
+ | |||
+ | If you wish, we can remote into your server and try to recover the data for you, but there will be a [[http:// | ||
+ | |||
+ | =====Possible Causes===== | ||
+ | The most common causes of this type of corruption are some third party software accessing the pgsql\data folder files - usually a virus scanner or backup or file synchronisation program. Backup programs using the Windows ' | ||
+ | |||
+ | Note that if you use a backup program which doesn' | ||
+ | |||
+ | The only files in the pgsql\data folder which should ever be accessed by anything other than PostgreSQL itself are the contents of the '' | ||
+ | |||
+ | |||
+ | ====Possible alternative solution==== | ||
+ | You **may** be able to use the **[[http:// | ||
- | To do this: | ||
- | * open a command prompt and find the VPOP\pgsql folder | ||
- | * rename the **data** folder to **data_old** | ||
- | * run **bin\initdb -D < | ||
- | * When it prompts for a password, type in the password you want for the PostgreSQL superuser - we use **pgsqlpass**. If you choose to use something different, make sure you remember what it is! | ||
- | * type **copy data_old\postgresql.conf data** to copy the database server configuration to the new location | ||
- | * Start the PostgreSQL service in Windows | ||
- | * [[restore a backup of VPOP3|Restore the latest good database backup]] |