Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 2C0331975915 for ; Wed, 20 Jun 2012 21:28:54 -0300 (ADT) Received: from smtp.01.com ([199.36.142.181]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ShVGW-0007nb-Q8 for pgsql-performance@postgresql.org; Thu, 21 Jun 2012 00:28:53 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id 2432B3F6563 for ; Wed, 20 Jun 2012 19:28:40 -0500 (CDT) X-Virus-Scanned: amavisd-new at smtp-out-1.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-1.01.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SsQkC9bGzoWZ for ; Wed, 20 Jun 2012 19:28:40 -0500 (CDT) Received: from smtp.01.com (localhost.localdomain [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id EDAAD294004 for ; Wed, 20 Jun 2012 19:28:39 -0500 (CDT) Received: from Sidney-Stratton.local (70-36-143-92.dsl.dynamic.sonic.net [70.36.143.92]) by smtp-out-1.01.com (Postfix) with ESMTPSA id A81633F5AE5 for ; Wed, 20 Jun 2012 19:28:39 -0500 (CDT) Message-ID: <4FE26AB6.1060407@agliodbs.com> Date: Wed, 20 Jun 2012 17:28:38 -0700 From: Josh Berkus Organization: PostgreSQL Experts Inc. User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: moving tables References: In-Reply-To: X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/114 X-Sequence-Number: 47140 On 6/20/12 3:27 PM, Midge Brown wrote: > I need to move a postgres 9.0 database -- with tables, indexes, and wals associated with 16 tablespaces on 12 logical drives -- to an existing raid 10 drive in another volume on the same server. Once I get the data off the initial 12 drives they will be reconfigured, at which point I'll need to move everything from the 2nd volume to the aforementioned 12 logical drives on the first volume. This is being done both to free up the 2nd volume and to better utilize raid 10. > > I checked around and found a way to create sql statements to alter the public tablespaces and indexes, but I haven't found anything that provides information about moving the numerous associated config files, log files, etc. > > ANY comments, suggestions, or direction to existing documentation would be greatly appreciated. 1. back everything up. 2. create a bunch of directories on the RAID10 to match the existing tablespaces (they won't be mounts, but Postgres doesn't care about that). 3. shut down postgres 4. copy all your files to the new directories 5. change your mount points which were in use by the old tablespaces to symlinks which point at the new diretories 6. start postgres back up from the new location -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com