Re: Upgrading Database: need to dump and restore?

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
Cc: Carlos Oliva <carlos(at)pbsinet(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Upgrading Database: need to dump and restore?
Date: 2009-06-03 19:35:56
Message-ID: 20090603153556.f05e6bd2.wmoran@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In response to Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>:

> On Wed, Jun 3, 2009 at 8:14 PM, Bill Moran <wmoran(at)potentialtech(dot)com> wrote:
> > In response to "Carlos Oliva" <carlos(at)pbsinet(dot)com>:
> >
> >> Woudl it be possible to keep the current postgresql version running in a
> >> different port, install a new version of postgresql, and copy the data from
> >> one version to the other while both versions are running?  This might give
> >> us time to copy the tables and databases one at a time and reconfigure the
> >> database access for parts of the application until we complete the migration
> >> to the new version.
> >
> > Your best bet would be to install Slony-I.  One of the main design goals
> > for Slony is to allow interruption-free upgrades.
>
> I don't think it is "easy", but will do if you need to synchronize
> data before switching.

"easy" was not the point. I gathered from his comments that downtime is
an issue, and I know (from experience) that Slony provides the ability
to upgrade with almost no downtime, even with very large databases.

His plan of migrating tables one at a time may work, but it's frighteningly
error-prone. If he copies a table, how does he know the data hasn't
changed during the copy? What if he doesn't quite get all the clients
switched over all at once? How do you do a JOIN when one table is in
one database and the other somewhere else?

Once the DBs are in sync with Slony, a single command will switch to the
new server. If it doesn't go well (because he has a client compatibility
problem, for example -- casts anyone?) it's a simple process to switch
back, all with a guarantee that his data will never be lost, out of sync
or corrupted.

And if his application requires small downtime windows, this is a process
he will benefit from getting familiar with anyway.

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jennifer Trey 2009-06-03 19:41:31 Re: High I/O writes activity on disks causing images on browser to lag and not load
Previous Message Greg Smith 2009-06-03 19:26:17 Re: warm standby with WAL shipping