From owner-freebsd-questions@FreeBSD.ORG Thu May 29 12:47:01 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F046A1065678 for ; Thu, 29 May 2008 12:47:00 +0000 (UTC) (envelope-from gunther.mayer@googlemail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by mx1.freebsd.org (Postfix) with ESMTP id 1C0528FC17 for ; Thu, 29 May 2008 12:46:58 +0000 (UTC) (envelope-from gunther.mayer@googlemail.com) Received: by ug-out-1314.google.com with SMTP id q2so96442uge.37 for ; Thu, 29 May 2008 05:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:user-agent:mime-version:to:subject:content-type:content-transfer-encoding:from; bh=XCp5qL3yPV+K6Q3zzyFdSg5gfuMdSa0JT5Iz2tLMPDM=; b=tKcwgk3085oZ4uKkrRPqkfOxRm9r6H1XI8M9LFr0gZ6Pdc4Y0TrKA/9V0S0cf9EqlCqDfi/88qpyK3e5DkbzZFBzEPkCnlgbplvpT0nmS04fv/r3167VabbaCZjR8efy2LrxIXh9y2jc7yHo4M+42rnM8VScta4HrWtpZbffRK8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:user-agent:mime-version:to:subject:content-type:content-transfer-encoding:from; b=I9rQfukCj4oF+zhiT4cgkCwbwHdB9Zkksp6cx2nb2OcNlWB+ypeBMwQLY+JsRSWLgwsudmbfsMfx0mblXI1HYtwAvNkxB6hJFeYLTZJFBsSXCt6rpqcP4x3EPUomCbeqYQH3FmLk7ElyDjnYYwb7WgJI5Wliw/ImFBa9Y4G49mI= Received: by 10.67.27.3 with SMTP id e3mr847612ugj.82.1212065216690; Thu, 29 May 2008 05:46:56 -0700 (PDT) Received: from ?172.25.0.133? ( [196.7.14.186]) by mx.google.com with ESMTPS id k28sm1339900ugd.41.2008.05.29.05.46.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 29 May 2008 05:46:49 -0700 (PDT) Message-ID: <483EA5AF.5040901@gmail.com> Date: Thu, 29 May 2008 14:46:39 +0200 User-Agent: Thunderbird 2.0.0.14 (X11/20080502) MIME-Version: 1.0 To: FreeBSD Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit From: Gunther Mayer Subject: Best way of upgrading postgresql in production? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2008 12:47:01 -0000 Hi guys, I've been grappling with this and read all sorts of email threads and blog posts but I still have no good solution to the following problem: I want to upgrade a postgresql installation on FreeBSD 6.3 from 8.2 to 8.3 as we'd like to take advantage of its new features and performance enhancements. Yet none of the ports system offers no clean _and_ quick way of performing such an upgrade as the Makefiles of the respective ports choke as soon as they detect an existing older -server or -client. Yet all I want to do is in a script which fires automatically at 5am via cron (of course I'll get up to check just in case but I've done this many times before): 1. Do all backup tasks (build packages for all installed postgresql 8.2 stuff for possible rollback, full database dump, configs etc.) and take down all processes that write to the db 2. Shut down the database 3. Uninstall all postgresql 8.2 ports (client, server and client libs we depend on) 4. Install all postgresql 8.3 ports 5. Fire up the new db, restore the complete database dump 6. Restore the configs (pg_hba.conf, postgresql.conf etc.) and restart the database 7. Start up all "db write" services again Ideally that process shouldn't take longer than 5 minutes but step number 4 is currently a big stumbling block as * Building from ports will take a while * I can't find any binary packages for 8.3 (would need i386 for testing and amd64 for live) anywhere as far as I can see (ftp.freebsd.org has nothing, nor do the mirrors) * building binary packages myself is impossible on the same machines as pkg_create can only do that with installed packages, "make package" et. all choke when they realise you already have 82-{client,server} installed and I don't see any other way of creating a package without installing one How can I get out of this catch-22 /without /resorting to complicated jail setups or even worse, manual compilations with different prefixes and other nasties? There must be a way to get a package somehow... Gunther