Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moving postgresql data cluster

Our postgres data folder was installed on a drive with very limited space. I'm now trying to move it over to a newly mounted drive (more space). I've followed several blog posts and they all say...

  1. stop service
  2. copy data cluster
  3. update postgresql-9.1 file (PGDATA=)
  4. restart service

The service starts but when I go to connect, it gives me "could not connect to server: Connection refused"

I tried telnet-ing to port 5432 and nothing.

Here is the link to what I've been trying: http://www-01.ibm.com/support/docview.wss?uid=swg21324272

like image 744
sam yi Avatar asked Jun 29 '12 16:06

sam yi


People also ask

What is the best way to transfer the data in a PostgreSQL database?

Data export with pg_dump The idea behind this dump method is to generate a file with SQL commands that, when fed back to the server, will recreate the database in the same state as it was at the time of the dump. PostgreSQL provides the utility program pg_dump for this purpose.

What is data migration in PostgreSQL?

PostgreSQL database migration is the process of moving data from a source database to a target one. Benefit from quick and seamless Postgres data migration and get a simple method to transfer your PostgreSQL data between different servers, databases, and IDEs.


1 Answers

Thanks everyone for your help. Looks like the problem was with permissioning.

Instead of doing

cp -R fromfolder tofolder

I did

cp -a fromfolder tofolder

And that solved it. Thanks all.

like image 124
sam yi Avatar answered Oct 21 '22 01:10

sam yi