Transferring postgresql data from linode to digital ocean

Posted August 28, 2014 2.5k views


What would be the steps to transfer data from linode to digital ocean ? I am using postgresql and have gone through this but it does not seem to help as when I dump the databse the file seems to be empty .

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

If you are using Postgres, the commands will differ from MySql. To dump the database (and compress it), run:

pg_dump dbname | gzip > filename.gz

Then you can restore it on your new server with:

cat filename.gz | gunzip | psql dbname

Check out the official Postgres docs on backing up.