Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I upgraded a server with a Rails application to Ubuntu 12.04 from 10.04 and cannot connect to Postgresql database now...

Here is the error message from Rails app:

could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"

Also the pg_ctl start is not recognized as a command.


Turns out my database is on Postgresl 8.4 and my sever is now running on 9.1. So all the database files / configs are on 8.4..

How can I transfer them? Just straight copy from old pg_hba.conf?

share|improve this question

Well, you should probably start with the Postgres documentation on upgrading to 9.1.x.

I can tell you two things for certain:

  1. It is more complicated than just copying a few files around.
  2. This is something you should have investigated and planned before you did your server upgrade.
    (think of the annoying process you now have to go through as an object lesson in proper planning)

Considering your situation, every upgrade path will require you to install appropriate 8.4.x binaries. You will probably be best served by using the pg_upgrade process, as it will be less time-consuming than a dump/restore in most cases.

Of course before you do anything else you should MAKE A BACKUP OF YOUR POSTGRES DATA DIRECTORY. The data (and job) you save may be your own...

share|improve this answer

Your Answer


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.