Restoring a database from a file system snapshot

From: William Garrison <postgres(at)mobydisk(dot)com>
To: Postgres General List <pgsql-general(at)postgresql(dot)org>
Subject: Restoring a database from a file system snapshot
Date: 2008-08-27 17:54:11
Message-ID: 48B594C3.3070407@mobydisk.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a PostgreSQL database on Windows Server 2003, and the database is
kept on a SAN that has the ability to make instantaneous snapshots.
Once I have made such a snapshot, I am unclear how to re-attach it to
another postgres database on another machine. Postgres seems to create
a directory structure that looks like this:
Z:\MyDatabase
Z:\MyDatabase\PG_VERSION
Z:\MyDatabase\1234567
Z:\MyDatabase\lots of files...
The "1234567" number above changes with each new database I create.

So to restore a snapshot, I create a new database, which makes a
X:\NewDatabase\98765 directory. Do I then drop the contents of the
Z:\MyDatabase\1234567\* inside of the X:\NewDatabase\98765? I attempted
this some time ago, and postgres refused to start. (I haven't tried it
again so I don't know the exact error). I got the impression that this
is not the correct procedure, since the number (which I think
corresponds to the hard link inside C:\Program
Files\PostgreSQL\8.3\data\pg_tblspc) did not match. I am not sure what
else must be altered in order for the snapshot to "attach"

Any suggestions? Is my procedure correct? Would I need to also copy
the transaction logs or something like that?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joao Ferreira gmail 2008-08-27 18:08:23 Re: Restoring a database from a file system snapshot
Previous Message William Garrison 2008-08-27 17:45:43 Re: Do I have a corrupted database?