Re: database migration question between different ubuntus and different postgresql server versions - Mailing list pgsql-general

From Andrew Sullivan
Subject Re: database migration question between different ubuntus and different postgresql server versions
Date
Msg-id 20150416222249.GB3826@crankycanuck.ca
Whole thread Raw
In response to Re: database migration question between different ubuntus and different postgresql server versions  (Octavi Fors <octavi@live.unc.edu>)
List 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@crankycanuck.ca


pgsql-general by date:

Previous
From: Octavi Fors
Date:
Subject: Re: database migration question between different ubuntus and different postgresql server versions
Next
From: Adrian Klaver
Date:
Subject: Re: database migration question between different ubuntus and different postgresql server versions