Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 932DE632E8D for ; Thu, 15 Apr 2010 11:54:25 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 74116-02-5 for ; Thu, 15 Apr 2010 14:54:14 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from zql.com (3a.1f.de.static.xlhost.com [206.222.31.58]) by mail.postgresql.org (Postfix) with ESMTP id 7E952632414 for ; Thu, 15 Apr 2010 11:53:14 -0300 (ADT) Received: from localhost.localdomain ([127.0.0.1] helo=localhost) by zql.com with smtp (Exim 4.68) (envelope-from ) id 1O2QRL-0006QK-Td; Thu, 15 Apr 2010 10:53:11 -0400 From: "Greg Sabino Mullane" To: pgsql-admin@postgresql.org Subject: Re: Migrating from 8.3 to 8.4 on the same server X-PGP-Key: 2529 DF6A B8F7 9407 E944 45B4 BC9B 9067 1496 4AC8 X-Request-PGP: http://www.biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 In-Reply-To: <4BC7167E.2080504@setonhome.org> Date: Thu, 15 Apr 2010 14:53:11 -0000 X-Mailer: JoyMail 2.4.0 Message-ID: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201004/191 X-Sequence-Number: 34285 -----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 >> Keep in mind that if you have tables and/or databases that don't >> change frequently, you can dump those beforehand to minimize >> the final downtime. > That's true, I had thought about that also. I guess I would save the > contents of the biggest tables to flat files using the COPY command, > then delete the copied rows, before doing the dump. Is what what you > had in mind? No need to delete the copied rows: just use the handy -t and -T flags for pg_dump to include/exclude specific tables. You also don't need to save to a flat file first unless you need/want a separate backup. For large tables foo and bar, assuming 8.3 on port 5432 and 8.4 on port 5840, you could do: * pg_dump -t foo -t bar -p 5432 | psql -p 5840 -f - Then your final migration steps would be: * Stop the app * pg_dump -T foo -T bar -p 5432 | psql -p 5840 -f - * Turn fsync back on and change the port to 5432 for 8.4 * Stop the 8.3 database * Restart 8.4 * Start the app All off the top of my head, requires heavy testing by QA first, assumes foo and bar are not used, etc. /disclaimer - -- Greg Sabino Mullane greg@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201004151050 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -----BEGIN PGP SIGNATURE----- iEYEAREDAAYFAkvHKDkACgkQvJuQZxSWSsjasACgmepXTrkz/rsoHsm/qKWxsyB9 YlYAoJHHeyd768IJC5RqNn2aXPD/80fp =6yRN -----END PGP SIGNATURE-----