Re: database migration question between different ubuntus and different postgresql server versions

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: database migration question between different ubuntus and different postgresql server versions
Date: 2015-04-16 22:22:49
Message-ID: 20150416222249.GB3826@crankycanuck.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Apr 16, 2015 at 06:14:20PM -0400, Octavi Fors wrote:
> at first glance, option 1) seems to me simpler. But does it guarantee
> server version upgrade compatibility?

Yes. Use the pg_dump from the later postgres, which can read old
versions and generate any output needed for the new version. It's
just like any other pg_dump otherwise.

> Could you/someone please provide an example of commands which I could use?

Usually pg_dump [connection options] databasename | psql [connection
options] databasename

For instance, if you wanted from the new machine to dump egdb from the
old machine and restore locally, you could do

pg_dump -U postgres -h 192.0.2.1 -C egdb | psql -U postgres

I recommend reading the pg_dump (and if you like, pg_dumpall) manuals
before proceeding.

A

--
Andrew Sullivan
ajs(at)crankycanuck(dot)ca

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2015-04-17 00:35:47 Re: database migration question between different ubuntus and different postgresql server versions
Previous Message Geoff Speicher 2015-04-16 22:21:20 Re: fillfactor and cluster table vs ZFS copy-on-write