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?