Re: Replacing a production db

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Replacing a production db
Date: 2014-06-18 20:59:36
Message-ID: 53A1FDB8.8000209@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andy Colson 2014-06-18 21:27:19 Re: Replacing a production db
Previous Message Tim Clarke 2014-06-18 20:54:15 Re: Replacing a production db