I'm in a bit of a pickle here. I managed to copy the whole postgresql installation directory to a backup drive but how would I retrieve it from Linux with the same architecture and version. Is this possible? I wasn't able to do a backup.
Sign up
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
There's no way to dump your Windows PostgreSQL database directory using Linux directly1. You need to start up a virtual machine running Windows, then copy the database directory to that virtual machine. You can then You must make sure that if your PostgreSQL data directory was from 64-bit PostgreSQL you install a 64-bit Windows version and install 64-bit PostgreSQL on it. If your PostgreSQL data dir is 32-bit it doesn't matter whether you install 32-bit or 64-bit Windows, but you must install 32-bit PostgreSQL. Licensing restrictions mean that you can't just download a virtual machine image for Vagrant or whatever to run Windows. You will need a Windows install DVD or ISO image. It's possible to download these legally from Microsoft's digital distribution system if you don't already have a DVD or ISO. You can install them without a license key, but it'll disable its self after a few days, and it's not legal to use it without possessing a license. For that reason, unless the database is really huge one of the best options is to sign up to Amazon EC2 (if you haven't already) and launch a Windows Server virtual machine on EC2. You can install PostgreSQL then copy your database to that virtual machine, run 1 It's possible you might be able to run PostgreSQL using WINE, but I suspect that'd be even more complicated, if it works at all, and probably not particularly trustworthy. So just use Windows. |
|||||||||
|
pg_dump
andpg_restore
– a_horse_with_no_name Oct 29 '15 at 9:05pg_dump
wherever your current Postgres installation is running andpg_restore
wherever your new Postgres installation is running. Both are client programs, so you can actually run them on any computer that can connect to the the running Postgres instances – a_horse_with_no_name Oct 29 '15 at 9:12pg_dump
andpg_restore
do work across different operating systems. This is all explained in the manual. – a_horse_with_no_name Oct 29 '15 at 9:19