Restoring a database from a file system snapshot - Mailing list pgsql-general

From William Garrison
Subject Restoring a database from a file system snapshot
Date
Msg-id 48B594C3.3070407@mobydisk.com
Whole thread Raw
Responses Re: Restoring a database from a file system snapshot
Re: Restoring a database from a file system snapshot
List 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?

pgsql-general by date:

Previous
From: William Garrison
Date:
Subject: Re: Do I have a corrupted database?
Next
From: Joao Ferreira gmail
Date:
Subject: Re: Restoring a database from a file system snapshot