Re: Problem in offline backup & restore

From: John Purser <jmpurser(at)gmail(dot)com>
To: Sree Narayana <sreeman007(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Problem in offline backup & restore
Date: 2006-09-05 14:38:52
Message-ID: 1157467132.5378.6.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Tue, 2006-09-05 at 19:33 +0530, Sree Narayana wrote:
> Hi
>
> I am trying to implement backup and restore feature.
>
> For backup I am issuing the command from windows cmd prompt:
>
> C:\ [path to pg_dump.exe ]\pg_dump.exe -i -h localhost -p 5432 -U
> postgres -F c -b -v -f C:\MyBackups\db_backup.backup mydb
>
> For restore I am issuing the following command:
> C:\[path to pg_restore.exe ]\pg_restore.exe -i -h localhost -p 5432 -U
> postgres -d mydb -c -v C:\MyBackups\db_backup.backup
>
> The above 2 commands working perfect while database is online
> (running).
>
> However the problem is they are not working while database is offline
> (database shutdown)
>
> It is showing the following error message:
>
> pg_dump: [archiver (db)] connection to database "mydb" failed: could
> not connect
> to server: Connection refused (0x0000274D/10061)
> Is the server running on host "localhost" and accepting
> TCP/IP connections on port 5432?
> pg_dump: *** aborted because of error
>
> Is it possible to backup & restore the database offline? If so what is
> the problem in my command.
>
> Please help me.
>
> Thanks
>
> Sreeman

Morning Sreeman,

The backup and restore commands are commands TO a running instance of
postgresql. Without the server running they can't do anything. If
you're looking for a backup solution that doesn't require a running
instance of postgresql then look at doing a file system backup. For
this method to work postgresql CAN'T be running so you have to shut it
down before backing up and before restoring.

I do believe most people use the pgdump or pgdumpall method rather than
the file system method.

John Purser

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Srinivas Iyyer 2006-09-05 22:42:43 Removing duplicate keys and updating deleted entry key in other table
Previous Message Richard Broersma Jr 2006-09-05 14:24:26 Re: Problem in offline backup & restore