Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have lost my PostgreSQL 9.1 installation on my Ubuntu machine by update to Ubuntu 14.10. Now I have no (reasonably easy) way to export the data from my PostgreSQL 9.1 database. Is it possible to take the data directory from the Ubuntu machine, put it to a Windows machine and have Windows version of PostgreSQL 9.1 use it so that I can dump it?

share|improve this question
1  
apt.postgresql.org - install 9.1 from there. Or install a temporary copy of your old Ubuntu version in a VM for recovery purposes - virtualbox, kvm, vagrant, etc. A PostgreSQL data directory from Linux is not compatible with PostgreSQL on Windows. But really ... what about those backups you took before you upgraded, like you always do? –  Craig Ringer Oct 30 '14 at 13:15
    
@CraigRinger: Well, it is a personal desktop machine and the DB there is not that super important but it would be nice to be able to migrate it. Thank for the APT link, I will try that. –  wilx Oct 30 '14 at 13:21
    
@CraigRinger: I have managed to recover my data. If you make your comment an answer I will accept it. –  wilx Oct 30 '14 at 20:19

1 Answer 1

up vote 1 down vote accepted

The best option is probably to install PostgreSQL 9.1 from http://apt.postgresql.org/ if it's available for your distro/version.

If not, you can install a temporary copy of your old Ubuntu version in a VM for recovery purposes - use virtualbox, kvm, etc. Vagrant can make life easier, just grab a prebuilt Ubuntu box from https://vagrantcloud.com/search?utf8=%E2%9C%93&sort=&provider=&q=ubuntu , bring it up, restore your DB, dump it, and shut the box down again.

A PostgreSQL data directory from Linux is not compatible with PostgreSQL on Windows. So you cannot use a 9.1 install on Windows to restore your data from Linux.

Once you've recovered, set up regular backups.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.