Restoring a raw PostgreSQL backup from an ancient server? -


all guides can find suggest migrating psql database easy. call pg_dump out @ 1 end , can suck @ other. simple if remembered pg_dump!

two years or ago, migrated server crusty old 32bit server newer, fresher 64bit install. backed essentials (/etc, /var, /home, etc...) being quite new @ time, ignored postgresql , didn't restore on new server.

sound odd? client uses moodle site use once in moon , has never needed in time. it's full moon today. client savage database isn't available.

i have /var/lib/postgresql/9.1/... files initial backup still. try supplant new /var/lib/postgresql/9.3/... files different arch, , i've read several things suggesting won't work. don't want things worse.

is there way restore old database or somehow convert neutral plaintext sql can reimported?

you correct 64-bit postgresql can't read 32-bit postgresql data directory. nor 9.3 read 9.1 data directory.

you need 32-bit postgresql 9.1 access this.

because x86_64 cpu can run 32-bit binaries without emulation, have couple of options:

  • install 32-bit postgresql 9.1 using debian/ubuntu packages directly on current system, pulling in required 32-bit libraries. i'd try first, might easiest. check http://apt.postgresql.org/ see if there 32-bit 9.1 binaries os.

  • failing that, launch virtual machine running original operating system data directory created on using libvirt+kvm, vagrant+virtualbox, or whatever, install postgresql 9.1 original os packages on it.

  • as final alternative install 32-bit gcc , relevant postgresql dependencies (apt-get build-essential:i386, apt-get build-dep postgresql:i386 think, don't have debian/ubuntu machine hand test with) compile postgresql 9.1 i386 using toolchain.

whichever way it, want use 9.1 binaries to path=/path/to/9.1/bin pg_ctl -d /path/to/copy/of/database -w start postgresql, pg_dump - if possible, using new pg_dump 9.3. strongly recommend using pg_dumpall --globals-only, pg_dump -fc each individual database wish dump.

now go check backups , make sure in future you're doing periodic dumps.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -