By paveltashev
Hello there,
I have the following issue. I have database PostgreSQL version 9.1. I have a second server with PostgreSQL 9.3. I want to move the data from PostgreSQL 9.1 to PostgreSQL 9.3. For that purpose I dumped the data from PostgreSQL 9.1 using the following command:
pg_dump -U postgres -Ft -p 5432 DB_NAME > DUMP_FILE_NAME.bkp.tar
And then I restored it to PostgreSQL 9.3:
pg_restore -U postgres -p 5432 -v -c -O -d NEW_DB_NAME DUMP_FILE_NAME.bkp.tar
The issue is that not the whole data was restored. Part of the tables were missing, a significant part of the functionalities, etc.
So, I have a question, is it possible to migrate the whole data somehow?
I also tried to install PostgreSQL 9.1 on the seconds server but PostgreSQL no longer supports version 9.1. That’s why it was necessary to do that with the help of the source code from here: http://www.postgresql.org/ftp/source/v9.1.13/
Then I followed the instructions:
http://www.postgresql.org/docs/9.1/static/install-procedure.html http://www.postgresql.org/docs/9.1/static/install-post.html
and few other articles on Internet. Result…nothing. I can’t tun PostgreSQL 9.1 using its source code. Can you please help?
Regards, Pavel
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
The key to migrating data from one major version of PostgreSQL to another is to you the pg_dump binary from the new version to dump the data from the old one. As mentioned in the PostgreSQL 9.3 upgrade docs:
It is recommended that you use the
pg_dumpandpg_dumpallprograms from the newer version of PostgreSQL, to take advantage of enhancements that might have been made in these programs. Current releases of the dump programs can read data from any server version back to 7.0.
While using pg_dump is the recommended route, if you are upgrading in place the pg_upgrade command is also useful. See more here.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.