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 1h3CDZ-0002WE-OA for pgsql-general@arkaria.postgresql.org; Mon, 11 Mar 2019 04:07:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h3CDY-0008Tj-IT for pgsql-general@arkaria.postgresql.org; Mon, 11 Mar 2019 04:07:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3CDY-0008Ox-1u for pgsql-general@lists.postgresql.org; Mon, 11 Mar 2019 04:07:12 +0000 Received: from mail-oln040092008011.outbound.protection.outlook.com ([40.92.8.11] helo=NAM03-DM3-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3CDV-0000En-0H for pgsql-general@lists.postgresql.org; Mon, 11 Mar 2019 04:07:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KY/YZOjrb2ALSvmicvIk534652Tgsa00dM+FXNmQNKM=; b=O3T7+35bfqO4ZjlLR1xH0uXuekO+H7pFUdoW9Aa87W8sDCzrBW/fjueHg3DSr/czHRGGjgKp7d6YSAQZ9I1sYyLro3TB28MomzVx9ON6YqufuHWaK2f4n49hsrZI9uTFsvDz2yvmeRVVNR/808K5gkQwdWgRd56XnxzN1V7AKOuSh7SBmLw/MZWQaMYYdIr/or/BxiwnuNd2GZ7pDGyfbyRXwHWd79z3Ompbi6IshWLCPveB1suH93ucdDKtG5QmHIWwqhGAvRxa1Qe8IgUFsdifAtud5tlz/Xc1dNUnjiDjq1j5TWS0L6y1el2BKH4DVFx8RNlzuIz5LU/dfHATXQ== Received: from BY2NAM03FT056.eop-NAM03.prod.protection.outlook.com (10.152.84.53) by BY2NAM03HT237.eop-NAM03.prod.protection.outlook.com (10.152.85.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.19; Mon, 11 Mar 2019 04:07:05 +0000 Received: from BYAPR08MB5014.namprd08.prod.outlook.com (10.152.84.60) by BY2NAM03FT056.mail.protection.outlook.com (10.152.85.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.19 via Frontend Transport; Mon, 11 Mar 2019 04:07:05 +0000 Received: from BYAPR08MB5014.namprd08.prod.outlook.com ([fe80::e141:e5bc:51c5:5bdb]) by BYAPR08MB5014.namprd08.prod.outlook.com ([fe80::e141:e5bc:51c5:5bdb%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 04:07:05 +0000 From: Julie Nishimura To: Adrian Klaver , "pgsql-general@lists.postgresql.org" Subject: Re: migration of 100+ tables Thread-Topic: migration of 100+ tables Thread-Index: AQHU16NGnDTJd5fmoECSFYOvvpTYG6YFpEYAgAAsIUk= Date: Mon, 11 Mar 2019 04:07:05 +0000 Message-ID: References: ,<06e27bdf-e046-32f8-af1c-55a60c21a88b@aklaver.com> In-Reply-To: <06e27bdf-e046-32f8-af1c-55a60c21a88b@aklaver.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:EBE0725317D6750B549CFD68660D3B44B1F8F0BB5E7BB22B491C22390882B285;UpperCasedChecksum:9D985B49E3C54EF9EAEEB2BFB4294164817281253A7795612D344BA90F12F911;SizeAsReceived:6916;Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [rnmFML/fymCnK0U9lp5FzQ6ghZ9DWcY3] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(20181119110)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031322404)(2017031323274)(2017031324274)(1601125500)(1603101475)(1701031045);SRVR:BY2NAM03HT237; x-ms-traffictypediagnostic: BY2NAM03HT237: x-microsoft-antispam-message-info: VM5yP5DZWvbtPG+VKNA2SKk0gLCDybBaxurSe1n9TSc8STDiLHaLOHp1OEauGare Content-Type: multipart/alternative; boundary="_000_BYAPR08MB50148E3674D8D207892BABBAAC480BYAPR08MB5014namp_" MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: bb446af1-c77f-401c-bb4a-08d6a5d70619 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 04:07:05.7304 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2NAM03HT237 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --_000_BYAPR08MB50148E3674D8D207892BABBAAC480BYAPR08MB5014namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Oh, this is great news! Yay, thanks! ________________________________ 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 --_000_BYAPR08MB50148E3674D8D207892BABBAAC480BYAPR08MB5014namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Oh, this is great news! Yay, thanks!


From: Adrian Klaver <a= drian.klaver@aklaver.com>
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 s= erver (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 <= br> > 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://w= ww.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://w= ww.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
--_000_BYAPR08MB50148E3674D8D207892BABBAAC480BYAPR08MB5014namp_--