Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uATpG-00Fqqr-38 for pgsql-general@arkaria.postgresql.org; Thu, 01 May 2025 13:19:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uATpD-002wAz-J4 for pgsql-general@arkaria.postgresql.org; Thu, 01 May 2025 13:19:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uATpD-002wAr-58 for pgsql-general@lists.postgresql.org; Thu, 01 May 2025 13:19:40 +0000 Received: from mail-oi1-x231.google.com ([2607:f8b0:4864:20::231]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uATpC-000XhH-10 for pgsql-general@postgresql.org; Thu, 01 May 2025 13:19:39 +0000 Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-3f6a92f234dso742488b6e.3 for ; Thu, 01 May 2025 06:19:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746105576; x=1746710376; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=JspdBQ7Nhxrs7d86g2MAozcC3QFter5yLnTFDj2aB0A=; b=aYgg26Cex4zvh99odCCYtju4QnVuc28mw60mvbRNvehy3kow1XPzVKQl2y7cQowJAW f30syDpgxbPAkzbubbSslsUs/RfWmEtAdQWHFkkQs8bra0Ddqk9pIsx1nI65KKJOpSnT VsreHJCu7ZwIfcqAUwY5has4FBFXITORHwKIPfaXgyPk9rjmLQVCGvVdTuzjNuseOkJ/ j98wAs2Wmne3AMYK1QZ4ciliZ3GHaGNhOWyd+MCWC2It2wszRqlRTjhk711+bzb1TLOP U+RUan/1sqvzMGNMkCbO09ZIpgNhgFo1vbZJytXxm+52YANLYAAKUqef3oTrRIqHE46b Dj6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746105576; x=1746710376; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JspdBQ7Nhxrs7d86g2MAozcC3QFter5yLnTFDj2aB0A=; b=wGnG6ZiVOnye5ZVdBSSwnqcEpCnonCEv3teahG4a87TT9fXT0VFbC5+KudkG14OCaF 9FVL/vag8oPhq1ExTu/5gco/RjuAV37pWt56Lo7pglFko0WDPwqkoC7GVf81PITjmm3H SYhcdlvUQvUtSexMwn++NdRkl91Tf4U/80ZXnscg6VkjGLsqJ9KVMhFBqIJ4iE6mNv44 n/oW2zNXxV3tsFHqLeeqkhQqhv5i1neLTTsi+NSJF0STiuFBPzRcAd9e6Dy7NP97dKTC pm7Ne3gY8CwO1TfixH2XNs/3BGxxcN++H0F7qse/xYTsSSAAXkiBJCqesYEvXbEgxNgw KFig== X-Gm-Message-State: AOJu0YxauwTBW5r2bOZUtFkLn8d1zaGB5XHvxG3BcCGMKmrzqB7KOEDq OnslR6wkVC8SDZfCyYL24x4O5rNwMmAznb66fhzUuyb9brCb1ttY3QovhkD63Ly5JTCp99JaK4L UEA1jfFJYkPpckOei0RggqZl5TrMHV4hF X-Gm-Gg: ASbGncuJR2YYn4EzPk4YfX/Zz/Hsev5UuWeYjBeJJ7ixILnRArA2YM5I1ImUfVCKgbD Mujasr2s0rPxPHADBfPRkWR0wwDNeQnvQFcGy9jA4/+m0wK3aSiOQpRP7NG7tyTFSxONOS+ps+7 9armmLrfGTmQl0ho+TdDBHNL0= X-Google-Smtp-Source: AGHT+IEYW+jY0IqXqK2SkUACG7B+Wno23iImLdDO3OrDbrhuLMHloAI8s51dWYWqOHj+cIrCx0//N/DBM2uKImICgCA= X-Received: by 2002:a05:6808:6c88:b0:3fe:ab15:5ecb with SMTP id 5614622812f47-402c725f497mr3508374b6e.9.1746105576162; Thu, 01 May 2025 06:19:36 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ron Johnson Date: Thu, 1 May 2025 09:19:25 -0400 X-Gm-Features: ATxdqUGPCeQCj09nud83JQEuQe5XirmFP_zGoEzikYZ5j9BvhCKCaFmWOjIYWck Message-ID: Subject: Re: Upgrading PG11 to PG17 without dump/restore To: Postgres General Content-Type: multipart/alternative; boundary="0000000000009b8b75063412e27c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000009b8b75063412e27c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, May 1, 2025 at 9:06=E2=80=AFAM Durumdara wrot= e: > Hello! > > There is a heavily used server, with older debian, and PG11. > The data is more than 1,2 TB. > The PG_Upgrade is not possible because of lesser space and too old debian= . > > As we see now we have only one way to move this server. > 1.) Installing a new server with actual debian. > 2.) Installing the newest PG (17) on it. > 3.) Stop work on one database. Dump it in the old, restore it in the new > and start the work with that. So we can move them one by one. > > But this seems to be very hard, because we need to do this through an > internet connection, and the data is too much. > The new server isn't in the same data center? > I have a question about it - is there a better way to do this? > > For example we make a new cluster element (a read only slave) with newest > debian/PG, and use it to move the data in the background (replication). > And then we rename it to master. But I don't know if it's possible or not= . > Maybe the slaves must be the same version as the master. > > The main problem is that debian is too old, and we are afraid to use > PG_Upgrade because of too many version differences (11 < 17). > The fear is justified, since collation changes might corrupt text indices. > But maybe you have some good advice, how to do this with less complicatio= n. > Users can tolerate short downtimes, but not longer ones. > Logical replication, not physical replication. Works great if there's not many DDL changes. Another possibility is COPY TO / COPY FROM in chunks. This will work if most of the 1.2TB is inserted, and then never updated or deleted. That way, at cutover, you only need to COPY TO / COPY FROM and dump/restore (which is really a wrapper around COPY TO / COPY FROM) and "pg_restore --section=3Dpost-data". You (hopefully) know your system better than we do, so you'd have to decide which is better. --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --0000000000009b8b75063412e27c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, May 1, 2025 at 9:06=E2=80=AFAM Du= rumdara <durumdara@gmail.com&= gt; wrote:
Hello!

Ther= e is a heavily used server, with older debian, and PG11.
The data is mo= re than 1,2 TB.
The PG_Upgrade is not possible because of lesser = space and too old debian.

As we see now we have on= ly one way to move this server.
1.) Installing a new server with = actual debian.
2.) Installing the newest PG (17) on it.
3.) Stop work on one database. Dump it in the old, restore it in the new a= nd start the work with that. So we can move them one by one.

=
But this seems to be very hard, because we need to do this throu= gh an internet connection, and the data is too much.

The new server isn't in the same data center?
=C2=A0
I have a question about it - is there a better way to do th= is?

For=C2=A0example we make a new cluster element= (a read only slave) with newest debian/PG, and use it to move the data in = the background (replication).
And then we rename it to master. But I don= 't know if it's possible or not.
Maybe the slaves must be= the same version as the master.

The main problem = is that debian is too old, and we are afraid to use PG_Upgrade=C2=A0because= of too many version differences=C2=A0(11 < 17).

The fear is justified, since collation changes might c= orrupt text indices.
=C2=A0
But maybe you have some good advice= , how to do this with less complication.
Users can tolerate short down= times, but not longer ones.

Logical r= eplication, not physical replication.=C2=A0 Works great if there's not = many DDL changes.

Another possibility is COPY TO /= COPY FROM in chunks.=C2=A0 This will work if most of the 1.2TB is inserted= , and then never updated or deleted.=C2=A0 That way, at cutover, you only n= eed to COPY TO / COPY FROM and dump/restore (which is really a wrapper arou= nd COPY TO / COPY FROM) and "pg_restore --section=3Dpost-data".

You (hopefully) know your system better than we do,= so you'd have to decide which is better.

--
Death to <Redacted>, and butter sa= uce.
Don't boil me, I'm still alive.
<Redacted&= gt; lobster!
--0000000000009b8b75063412e27c--