User Tools

Site Tools


how_to:postgresql_server_won_t_start_due_to_damaged_log_files

This is an old revision of the document!


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.

To do this:

  1. Open a command prompt and find the VPOP\pgsql folder
  2. Rename the data folder to data_old
  3. Run
    bin\initdb -D <VPOP3folder>\pgsql\data -U postgres -W -A md5
  4. 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!
  5. Type
    copy data_old\postgresql.conf data

    to copy the database server configuration to the new location. You may be prompted if you want to overwrite the existing file. If so, confirm the overwrite.

  6. Set the permissions on the new Data folder. In Windows Explorer, right-click the VPOP3\pgsql\DATA folder and choose 'Properties' → 'Security'. Check that the 'postgres' user has 'Full control' of the folder.
  7. Start the PostgreSQL service in Windows
  8. From the command prompt in vpop3\pgsql\bin run
    createuser -S -D -R -U postgres -P vpop3

    At the 'Enter Password for new role' and 'Enter it again' prompts type vpop3pass. At the 'Password:' prompt type pgsqlpass (or whatever password you defined in the step 4 above)

Once you're happy everything is working OK, you can delete the data_old folder.

how_to/postgresql_server_won_t_start_due_to_damaged_log_files.1281100072.txt.gz · Last modified: 2018/11/14 10:44 (external edit)