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 1iSLFY-0007qV-Ay for pgsql-general@arkaria.postgresql.org; Wed, 06 Nov 2019 13:21:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iSLFW-00017R-Em for pgsql-general@arkaria.postgresql.org; Wed, 06 Nov 2019 13:21:26 +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 1iSLFW-00017J-5P for pgsql-general@lists.postgresql.org; Wed, 06 Nov 2019 13:21:26 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iSLFT-0004pT-7g for pgsql-general@lists.postgresql.org; Wed, 06 Nov 2019 13:21:25 +0000 Received: from [10.8.0.75] ([185.40.248.10]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPSA (Nemesis) id 1Mo73N-1i8AzS1KUl-00pZg9 for ; Wed, 06 Nov 2019 14:21:21 +0100 Subject: Re: Upgrade PGSQL main version without backup/restore all databases? To: pgsql-general@lists.postgresql.org References: From: Thomas Kellerer Message-ID: <45981fe3-34d4-e372-7d6d-af70e84e732a@gmx.net> Date: Wed, 6 Nov 2019 14:21:20 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:rg2MZ0dfyyNihjBT9X44/Zvk4rTk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u+NrQM5PS pXTe1OO4n3TaGOdxfm5o0/sUl5g1xWpYNayHnHzHyzCMV06rzH3gzUiBxeL27hfcLkqTxYv5N rLagmoB9kYwyXpu97LCpRSPUL34Nqrj9c64z/mhAA= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Durumdara schrieb am 06.11.2019 um 14:09: > We have PGSQL 9.6.xxx on a Linux server which heavily used. > More than 100 databases, and more than 300 active users, and it is a master of a cluster (the data replicated on a slave). > > Somewhere we have read that 9.6 will become unsupported shortly. "Shortly" is relative. It will fall out of support in 2021: https://www.postgresql.org/support/versioning/ But it's a good idea to plan the upgrade now. > We can't stop to lock out all users, make a dumpall, upgrade, restore > them all in new version, and then leave them to connect (200 GB of > data), because it is too long. > > Is there any way to upgrade PG and databases without backup/restore? Yes, you can use pg_upgrade. However it will still copy 200GB (but using a filecopy, not dump/restore) so it could still take some time. If you use it with the --link option, the upgrade will be very quick as only the catalog tables need to be copied (export/import). > Maybe the solution is to upgrade slave without sync the data changes > before; and if all is newer, leave to get the new data from the > master. I don't know it's possible or not. The newer PG slave could > make mistakes if the master have lower PG version... There are some ways to do a near-zero upgrade using logical replication, but it's not easy to configure. See this blog post for example: https://www.cybertec-postgresql.com/en/upgrading-postgres-major-versions-using-logical-replication/ Thomas