Thread: recovering using a continuous archive backup doesn't work on Windows

recovering using a continuous archive backup doesn't work on Windows

From
"Sabin Coanda"
Date:
Hi there,

I try to use WAL support for backup/recovery on Windows.

I applied the procedures from PostgreSQL 8.2.3 Documentation / 23.3.3.
Recovering using a Continuous Archive Backup.

I set the following archive commands:
- archive_command = 'copy "%p" "D:/Program
Files/PostgreSQL/8.2/test_sabin/%f"' #in postgresql.conf
- restore_command = 'copy "D:/Program Files/PostgreSQL/8.2/test_sabin/%f"
"%p"' #in recovery.conf

At the step 8, I start Postgresql Windows service. It starts, work about 30
seconds, then silently stops. In the event viewer I found just one message:
'The PostgreSQL Database Server 8.2 service entered the stopped state'. I
found no log in ../data/pg_log/, and my recovery.conf file is not renamed to
'recovery.done'.

What's happen ?

TIA,
Sabin



Re: recovering using a continuous archive backup doesn't work on Windows

From
"Sabin Coanda"
Date:
Hi,

The problem still persist, and I'm not able to fix it alone.
Is anyone which is using WAL on Windows to tell me some tips to make it
workable, or to confirm there is a problem, please ?

TIA,
Sabin



Re: recovering using a continuous archive backup doesn'twork on Windows

From
"Simon Riggs"
Date:
On Thu, 2007-03-29 at 18:18 +0300, Sabin Coanda wrote:

> The problem still persist, and I'm not able to fix it alone.
> Is anyone which is using WAL on Windows to tell me some tips to make it
> workable, or to confirm there is a problem, please ?

From your earlier problem description you seem to be attempting to run
two databases on one server. That requires a custom install, though even
if you did this it definitely would not provide you with any of the
outcomes you might want to create:

Are you trying to
a) run a backup with continuous archiving
http://www.postgresql.org/docs/8.2/static/continuous-archiving.html#BACKUP-ARCHIVING-WAL

b) run a restore from a continuous archive backup
http://www.postgresql.org/docs/8.2/static/continuous-archiving.html#BACKUP-PITR-RECOVERY

c) run a Warm Standby between two database servers
http://www.postgresql.org/docs/8.2/static/warm-standby.html

If you want to do (a) or (b) you've mistakenly read both parts of the
manual and if you want to do (c) then you need two servers, not just
one.

--
  Simon Riggs
  EnterpriseDB   http://www.enterprisedb.com



Re: recovering using a continuous archive backup doesn'twork on Windows

From
"Sabin Coanda"
Date:
>From your earlier problem description you seem to be attempting to run
> two databases on one server. That requires a custom install, though even
> if you did this it definitely would not provide you with any of the
> outcomes you might want to create:
>
> Are you trying to
> a) run a backup with continuous archiving
> http://www.postgresql.org/docs/8.2/static/continuous-archiving.html#BACKUP-ARCHIVING-WAL
>
> b) run a restore from a continuous archive backup
> http://www.postgresql.org/docs/8.2/static/continuous-archiving.html#BACKUP-PITR-RECOVERY
>
> c) run a Warm Standby between two database servers
> http://www.postgresql.org/docs/8.2/static/warm-standby.html
>
> If you want to do (a) or (b) you've mistakenly read both parts of the
> manual and if you want to do (c) then you need two servers, not just
> one.
>
> --
>  Simon Riggs
>  EnterpriseDB   http://www.enterprisedb.com

Hi Simon,

First of all, I didn't attempt to run two databases on one server. As I
said, I made the default install without any trickies.
I was trying to do first "23.3.1. Setting up WAL archiving", to enable WAL
archiving, and I specified in the previous email you the command on Windows.
This works perfectly, and I saw the generated WAL segment files.

Then I applied "23.3.2. Making a Base Backup", and I think it works well to.
I saw the backup file, and the new WAL segment files.

Then I tried "23.3.3. Recovering using a Continuous Archive Backup", and I
made every step from 1 to 8. Also I specified what was the "restore_command"
setting in recovery.conf file.

As I said, after precisely 30 seconds, Postgresql service stops, with just
one log message in the event viewer, saing "The PostgreSQL Database Server
8.2 service entered the stopped state".

Please detail how do you think that I mistakenly read both parts of the
manual ? What's wrong ?

Regards,
Sabin



Re: recovering using a continuous archive backup doesn'twork on Windows

From
"Sabin Coanda"
Date:
Hi,

Finally I solved it. It was just a rights access problem. When I
save/copy/move/cleanup the data directory, I used my account, and postgres
user had no rights to write/modify the new data directories. I give it
rights and the recovery works well now.

Regards,
Sabin

BTW: Although the rights access problems are obvious for experimented users,
it would be nice to find a warning/error message in the event logs from the
service that it has no write access in the directory.