Re: Replacing a production db - Mailing list pgsql-general

From John R Pierce
Subject Re: Replacing a production db
Date
Msg-id 53A1FDB8.8000209@hogranch.com
Whole thread Raw
In response to Replacing a production db  (Nicolás Lichtmaier <nico.lichtmaier@gmail.com>)
List pgsql-general
On 6/18/2014 1:05 PM, Nicolás Lichtmaier wrote:
> Is there a way to replace a production database with another as part
> of a new "release" of our website?
>
> Where I work we have a scheme of pushing code+db releases to "testing"
> and then to "production". Most of our databases use MySQL and I was
> told they can just rename the db and it works. We are adopting
> PostgreSQL for some new developments and we'd like to do something
> similar. I've tried loading the dump in a single transaction, but that
> has many problems as the database is fairly big for that (some GBs).
> Is there a trick I'm missing here?

we do updates of our production systems with .sql files that are version
deltas, eg, they alter existing tables and add new ones, possibly
including new 'static data'.   if the update requires code changes, then
we shut the app(s) down, run the database upgrade, install the new code,
and restart the app(s).   Usually we try to do our schema updates so the
old code will continue to work with the new schema, so the new code can
be cut in incrementally with virtually zero downtime.



--
john r pierce                                      37N 122W
somewhere on the middle of the left coast



pgsql-general by date:

Previous
From: Tim Clarke
Date:
Subject: Re: Replacing a production db
Next
From: Andy Colson
Date:
Subject: Re: Replacing a production db