From owner-svn-ports-head@freebsd.org Thu Aug 29 21:29:24 2019 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 279FCE065E; Thu, 29 Aug 2019 21:29:24 +0000 (UTC) (envelope-from tz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46KG2r0DLHz4D3w; Thu, 29 Aug 2019 21:29:24 +0000 (UTC) (envelope-from tz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEF2125FB4; Thu, 29 Aug 2019 21:29:23 +0000 (UTC) (envelope-from tz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7TLTNkk061990; Thu, 29 Aug 2019 21:29:23 GMT (envelope-from tz@FreeBSD.org) Received: (from tz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7TLTNPK061988; Thu, 29 Aug 2019 21:29:23 GMT (envelope-from tz@FreeBSD.org) Message-Id: <201908292129.x7TLTNPK061988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tz set sender to tz@FreeBSD.org using -f From: Torsten Zuehlsdorff Date: Thu, 29 Aug 2019 21:29:23 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r510189 - in head: . Mk X-SVN-Group: ports-head X-SVN-Commit-Author: tz X-SVN-Commit-Paths: in head: . Mk X-SVN-Commit-Revision: 510189 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 21:29:24 -0000 Author: tz Date: Thu Aug 29 21:29:23 2019 New Revision: 510189 URL: https://svnweb.freebsd.org/changeset/ports/510189 Log: Switch default version of PostgreSQL from 9.5 to 11 Two important changes arise with it: - Default user switches from "pgsql" to "postgres" - Default data-dir switches from "/usr/local/pgsql/data" to "/var/db/postgres/data11" Also add a migration procedure, which takes the user-switch into account by preventing it on database-side. Exp-Run: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239514 Thanks to: tobik, antoine, mfechner Sponsored by: Professionelles Bounce Management Modified: head/Mk/bsd.default-versions.mk head/UPDATING Modified: head/Mk/bsd.default-versions.mk ============================================================================== --- head/Mk/bsd.default-versions.mk Thu Aug 29 21:14:21 2019 (r510188) +++ head/Mk/bsd.default-versions.mk Thu Aug 29 21:29:23 2019 (r510189) @@ -81,7 +81,7 @@ _EXPORTED_VARS+= _PERL5_FROM_BIN PERL5_DEFAULT:= ${_PERL5_FROM_BIN:R} .endif # Possible values: 9.4, 9.5, 9.6, 10, 11, 12 -PGSQL_DEFAULT?= 9.5 +PGSQL_DEFAULT?= 11 # Possible values: 7.1, 7.2, 7.3 PHP_DEFAULT?= 7.2 # Possible values: 2.7, 3.5, 3.6, 3.7 Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Aug 29 21:14:21 2019 (r510188) +++ head/UPDATING Thu Aug 29 21:29:23 2019 (r510189) @@ -5,6 +5,63 @@ they are unavoidable. You should get into the habit of checking this file for changes each time you update your ports collection, before attempting any port upgrades. +20190829: + AFFECTS: users of database/postgresql* and other software using PostgreSQL to run + AUTHOR: tz@FreeBSD.org + + The default version of PostgreSQL has been switched from 9.5 to 11. + The upgrade procedure can use up twice the space the databases + currently needs. If you have a big amount of stored data take a + closer look at the manpage of pg_upgrade for avoidance and/or + speedup of the upgrade. + + The upgrade instructions consider a basic usage and do not match + complex scenarious like replication, sharding or similar. + + Upgrade instructions: + + First stop your PostgreSQL, create PostgreSQL-binaries and backup your data. + If you have another Version of PostgreSQL installed, for example 9.5.19, your + files are named accourding to this. + + # service postgresql stop + # pkg create postgresql95-server postgresql95-contrib + # mkdir /tmp/pg-upgrade + # tar xf postgresql95-server-9.5.19.txz -C /tmp/pg-upgrade + # tar xf postgresql95-contrib-9.5.19.txz -C /tmp/pg-upgrade + # pkg delete -f databases/postgresql95-server databases/postgresql95-contrib databases/postgresql95-client + + Now update PostgreSQL: + + pkg user: + # pkg install databases/postgresql11-server databases/postgresql11-contrib + # pkg upgrade + + Portmaster users: + # portmaster databases/postgresql11-server databases/postgresql11-contrib + # portmaster -a + + Portupgrade users: + # portinstall databases/postgresql11-server databases/postgresql11-contrib + # portupgrade -a + + After installing the new PostgreSQL version you need to convert + all your databases to new version: + + # su -l postgres -c "/usr/local/bin/initdb --encoding=utf-8 --lc-collate=C -D /var/db/postgres/data11 -U pgsql" + # chown -R postgres /usr/local/pgsql/data/ + # su -l postgres -c "pg_upgrade -b /tmp/pg-upgrade/usr/local/bin/ -d /usr/local/pgsql/data/ -B /usr/local/bin/ -D /var/db/postgres/data11/ -U pgsql " + + Now the migration is finished. You can start PostgreSQL again with: + + # service postgresql start + + ATTENTION: + 1) The default user changed from "pgsql" to "postgres". The migration steps above prevent the + user "pgsql" as database user while the database itself is executed using the "postgres" user of FreeBSD + 2) The default data dir changed from "/usr/local/pgsql/data/" to "/var/db/postgres/data11/" + 3) If you use non-default initdb options, you have to adjust the initdb-command accordingly + 20190816: AFFECTS: users of net-im/ejabberd AUTHOR: ashish@FreeBSD.org