Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3CM1-0002tK-DY for pgsql-general@arkaria.postgresql.org; Mon, 11 Mar 2019 04:15:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h3CLz-0001Vv-VO for pgsql-general@arkaria.postgresql.org; Mon, 11 Mar 2019 04:15:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3CLy-0001Vn-O7 for pgsql-general@lists.postgresql.org; Mon, 11 Mar 2019 04:15:55 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3CLu-0004Zb-QY for pgsql-general@lists.postgresql.org; Mon, 11 Mar 2019 04:15:53 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id CE32721AAA; Mon, 11 Mar 2019 00:15:49 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 11 Mar 2019 00:15:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=V TCqXrMbCsMaXDxL1J+wZbhB5bxcGFIypSatmyEm4q0=; b=wiiRbrwYzDnMpFKV/ wacxVZglUfevuC6iH3wxW4qsL1+dcOs03Raoo8voCDB7zJuYYzcZD1yMbSfRlm7v 6iH6PbppFK81OTUfYgDvTfv8IhMxgPwve+IfXorTQ0t4xGIIwIrZAW/nkgfG+RIy /a/YkEsz5gR+qY0DBj/ZZEfCxg0hqmpxkoOyvPkG3IEBSSQ4gVGya8bhTrHstztW gFmK1CJYFscUCNkeDyGbRQwumWynn7SeHPdQl1ShpOCXvRZlBgV5CQUpR6e+hOmm 6vm2BwmRoNepzYNMGpp2dr8SzmkLXe2nBcRK++ww9k6YEl9mHvKiSbllA2SK9E59 rRISw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=VTCqXrMbCsMaXDxL1J+wZbhB5bxcGFIypSatmyEm4 q0=; b=xyR4q9CaS5xeTub6NvlAxzrUhbbe4fxZszOGFKC4xzWQKb0PCxeXYx4Dw BhVjvuySSS+5Kj09aQxD6GQOQtpiYu10O9KaPyVEaGVgEjnl1mWaLaSgNHF/rEpS J7mJM9V13DXqe2PbF7pCbg3gWCdbu5hffXIHC4r6wgD4bRnA5zzj0TU0ZD5fop01 LWJdxEY8awawMbCsp9OzX9CfxfbmF15Ko+PJiZNjANupbKuMAoEfFGSzoB0zZQzS nFhiCqdw7KtcF+5JlhKzRhsTSxrnXsJMKTNmlsknucPhnHb60D2/FPw2BZu+/aGr +iMccTbexli1LKrq1YHK+Y+fM9uDQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrgeehgdeikecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthekre dttdefheenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmqeenucffohhmrghinhepphhoshhtghhrvghsqh hlrdhorhhgnecukfhppeejuddrvdduvddrudehtddrvddtvdenucfrrghrrghmpehmrghi lhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhenucevlh hushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id A323F10319; Mon, 11 Mar 2019 00:15:48 -0400 (EDT) Subject: Re: migration of 100+ tables To: Julie Nishimura , "pgsql-general@lists.postgresql.org" References: <06e27bdf-e046-32f8-af1c-55a60c21a88b@aklaver.com> From: Adrian Klaver Message-ID: Date: Sun, 10 Mar 2019 21:15:47 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 3/10/19 9:07 PM, Julie Nishimura wrote: > Oh, this is great news! Yay, thanks! Just be aware, where -n = --schema: https://www.postgresql.org/docs/10/app-pgdump.html " Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. " So any relationships across schema will not be preserved. > > ------------------------------------------------------------------------ > *From:* Adrian Klaver > *Sent:* Sunday, March 10, 2019 6:28 PM > *To:* Julie Nishimura; pgsql-general@lists.postgresql.org > *Subject:* Re: migration of 100+ tables > On 3/10/19 5:53 PM, Julie Nishimura wrote: >> Hello friends, I will need to migrate 500+ tables  from one server (8.3) >> to another (9.3). I cannot dump and load the entire database due to >> storage limitations (because the source is > 20 TB, and the target is >> about 1.5 TB). >> >> I was thinking about using pg_dump with customized -t flag, then use >> restore. The table names will be in the list, or I could dump their >> names in a table.  What would be your suggestions on how to do it more >> efficiently? > > The sizes you mention above, are they for the uncompressed raw data? > > Are the tables all in one schema or multiple? > > Where I am going with this is pg_dump -Fc --schema. > > See: > https://www.postgresql.org/docs/10/app-pgrestore.html > > The pg_restore -l to get a TOC(Table of Contents). > > Comment out the items you do not want in the TOC. > > Then pg_restore  --use-list. > > See: > > https://www.postgresql.org/docs/10/app-pgrestore.html > >> >> Thank you for your ideas, this is great to have you around, guys! >> >> > > > -- > Adrian Klaver > adrian.klaver@aklaver.com -- Adrian Klaver adrian.klaver@aklaver.com