Chapter 5. Migration
This chapter provides information on migrating to versions of components included in Red Hat Software Collections 3.6.
5.1. Migrating to MariaDB 10.3 Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
The rh-mariadb103 Software Collection is available for Red Hat Enterprise Linux 7, which includes MariaDB 5.5 as the default MySQL implementation.
The rh-mariadb103 Software Collection does not conflict with the mysql or mariadb packages from the core systems. Unless the *-syspaths packages are installed (see below), it is possible to install the rh-mariadb103 Software Collection together with the mysql or mariadb packages. It is also possible to run both versions at the same time, however, the port number and the socket in the
my.cnf files need to be changed to prevent these specific resources from conflicting. Additionally, it is possible to install the rh-mariadb103 Software Collection while the rh-mariadb102 Collection is still installed and even running.
The rh-mariadb103 Software Collection includes the rh-mariadb103-syspaths package, which installs packages that provide system-wide wrappers for binaries, scripts, manual pages, and other. After installing the rh-mariadb103*-syspaths packages, users are not required to use the
scl enable command for correct functioning of the binaries and scripts provided by the rh-mariadb103* packages. Note that the *-syspaths packages conflict with the corresponding packages from the base Red Hat Enterprise Linux system and from the rh-mariadb102 and rh-mysql80 Software Collections. To find out more about syspaths, see the Red Hat Software Collections Packaging Guide.
The recommended migration path from MariaDB 5.5 to MariaDB 10.3 is to upgrade to MariaDB 10.0 first, and then upgrade by one version successively. For details, see instructions in earlier Red Hat Software Collections Release Notes: Migrating to MariaDB 10.0, Migrating to MariaDB 10.1, and Migrating to MariaDB 10.2.
Note
The rh-mariadb103 Software Collection supports neither mounting over NFS nor dynamical registering using the
scl register command.
5.1.1. Notable Differences Between the rh-mariadb102 and rh-mariadb103 Software Collections Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
- The mariadb-bench subpackage has been removed.
- The default allowed level of the plug-in maturity has been changed to one level less than the server maturity. As a result, plug-ins with a lower maturity level that were previously working, will no longer load.
5.1.2. Upgrading from the rh-mariadb102 to the rh-mariadb103 Software Collection Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Important
Prior to upgrading, back up all your data, including any MariaDB databases.
- Stop the rh-mariadb102 database server if it is still running.Before stopping the server, set the
innodb_fast_shutdownoption to0, so thatInnoDBperforms a slow shutdown, including a full purge and insert buffer merge. Read more about this option in the upstream documentation. This operation can take a longer time than in case of a normal shutdown.mysql -uroot -p -e "SET GLOBAL innodb_fast_shutdown = 0"
mysql -uroot -p -e "SET GLOBAL innodb_fast_shutdown = 0"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Stop the rh-mariadb102 server.systemctl stop rh-mariadb102-mariadb.service
systemctl stop rh-mariadb102-mariadb.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Install the rh-mariadb103 Software Collection, including the subpackage providing the mysql_upgrade utility.
yum install rh-mariadb103-mariadb-server rh-mariadb103-mariadb-server-utils
yum install rh-mariadb103-mariadb-server rh-mariadb103-mariadb-server-utilsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note that it is possible to install the rh-mariadb103 Software Collection while the rh-mariadb102 Software Collection is still installed because these Collections do not conflict. - Inspect configuration of rh-mariadb103, which is stored in the
/etc/opt/rh/rh-mariadb103/my.cnffile and the/etc/opt/rh/rh-mariadb103/my.cnf.d/directory. Compare it with configuration of rh-mariadb102 stored in/etc/opt/rh/rh-mariadb102/my.cnfand/etc/opt/rh/rh-mariadb102/my.cnf.d/and adjust it if necessary. - All data of the rh-mariadb102 Software Collection is stored in the
/var/opt/rh/rh-mariadb102/lib/mysql/directory unless configured differently. Copy the whole content of this directory to/var/opt/rh/rh-mariadb103/lib/mysql/. You can move the content but remember to back up your data before you continue to upgrade. Make sure the data are owned by themysqluser and SELinux context is correct. - Start the rh-mariadb103 database server.
systemctl start rh-mariadb103-mariadb.service
systemctl start rh-mariadb103-mariadb.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Perform the data migration. Note that running the
mysql_upgradecommand is required due to upstream changes introduced in MDEV-14637.scl enable rh-mariadb103 mysql_upgrade
scl enable rh-mariadb103 mysql_upgradeCopy to Clipboard Copied! Toggle word wrap Toggle overflow If therootuser has a non-empty password defined (it should have a password defined), it is necessary to call the mysql_upgrade utility with the-poption and specify the password.scl enable rh-mariadb103 -- mysql_upgrade -p
scl enable rh-mariadb103 -- mysql_upgrade -pCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note that when the rh-mariadb103*-syspaths packages are installed, thescl enablecommand is not required. However, the *-syspaths packages conflict with the corresponding packages from the base Red Hat Enterprise Linux system and from the rh-mariadb102 and rh-mysql80 Software Collections.
5.2. Migrating to MySQL 8.0 Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
The rh-mysql80 Software Collection is available for Red Hat Enterprise Linux 7, which includes MariaDB 5.5 as the default MySQL implementation.
The rh-mysql80 Software Collection conflicts neither with the mysql or mariadb packages from the core systems nor with the rh-mysql* or rh-mariadb* Software Collections, unless the *-syspaths packages are installed (see below). It is also possible to run multiple versions at the same time; however, the port number and the socket in the
my.cnf files need to be changed to prevent these specific resources from conflicting.
Note that it is possible to upgrade to MySQL 8.0 only from MySQL 5.7. If you need to upgrade from an earlier version, upgrade to MySQL 5.7 first. For instructions, see Migration to MySQL 5.7.
5.2.1. Notable Differences Between MySQL 5.7 and MySQL 8.0 Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Differences Specific to the rh-mysql80 Software Collection
- The MySQL 8.0 server provided by the rh-mysql80 Software Collection is configured to use
mysql_native_passwordas the default authentication plug-in because client tools and libraries in Red Hat Enterprise Linux 7 are incompatible with thecaching_sha2_passwordmethod, which is used by default in the upstream MySQL 8.0 version.To change the default authentication plug-in tocaching_sha2_password, edit the/etc/opt/rh/rh-mysql80/my.cnf.d/mysql-default-authentication-plugin.cnffile as follows:[mysqld] default_authentication_plugin=caching_sha2_password
[mysqld] default_authentication_plugin=caching_sha2_passwordCopy to Clipboard Copied! Toggle word wrap Toggle overflow For more information about thecaching_sha2_passwordauthentication plug-in, see the upstream documentation. - The rh-mysql80 Software Collection includes the rh-mysql80-syspaths package, which installs the rh-mysql80-mysql-config-syspaths, rh-mysql80-mysql-server-syspaths, and rh-mysql80-mysql-syspaths packages. These subpackages provide system-wide wrappers for binaries, scripts, manual pages, and other. After installing the rh-mysql80*-syspaths packages, users are not required to use the
scl enablecommand for correct functioning of the binaries and scripts provided by the rh-mysql80* packages. Note that the *-syspaths packages conflict with the corresponding packages from the base Red Hat Enterprise Linux system and from the rh-mariadb102 and rh-mariadb103 Software Collections. To find out more about syspaths, see the Red Hat Software Collections Packaging Guide.
General Changes in MySQL 8.0
- Binary logging is enabled by default during the server startup. The
log_binsystem variable is now set toONby default even if the--log-binoption has not been specified. To disable binary logging, specify the--skip-log-binor--disable-log-binoption at startup. - For a
CREATE FUNCTIONstatement to be accepted, at least one of theDETERMINISTIC,NO SQL, orREADS SQL DATAkeywords must be specified explicitly, otherwise an error occurs. - Certain features related to account management have been removed. Namely, using the
GRANTstatement to modify account properties other than privilege assignments, such as authentication, SSL, and resource-limit, is no longer possible. To establish the mentioned properties at account-creation time, use theCREATE USERstatement. To modify these properties, use theALTER USERstatement. - Certain SSL-related options have been removed on the client-side. Use the
--ssl-mode=REQUIREDoption instead of--ssl=1or--enable-ssl. Use the--ssl-mode=DISABLEDoption instead of--ssl=0,--skip-ssl, or--disable-ssl. Use the--ssl-mode=VERIFY_IDENTITYoption instead of--ssl-verify-server-certoptions. Note that these option remains unchanged on the server side. - The default character set has been changed from
latin1toutf8mb4. - The
utf8character set is currently an alias forutf8mb3but in the future, it will become a reference toutf8mb4. To prevent ambiguity, specifyutf8mb4explicitly for character set references instead ofutf8. - Setting user variables in statements other than
SEThas been deprecated. - The
log_syslogvariable, which previously configured error logging to the system logs, has been removed. - Certain incompatible changes to spatial data support have been introduced.
- The deprecated
ASCorDESCqualifiers forGROUP BYclauses have been removed. To produce a given sort order, provide anORDER BYclause.
For detailed changes in MySQL 8.0 compared to earlier versions, see the upstream documentation: What Is New in MySQL 8.0 and Changes Affecting Upgrades to MySQL 8.0.
5.2.2. Upgrading to the rh-mysql80 Software Collection Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Important
Prior to upgrading, back-up all your data, including any MySQL databases.
- Install the rh-mysql80 Software Collection.
yum install rh-mysql80-mysql-server
yum install rh-mysql80-mysql-serverCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Inspect the configuration of rh-mysql80, which is stored in the
/etc/opt/rh/rh-mysql80/my.cnffile and the/etc/opt/rh/rh-mysql80/my.cnf.d/directory. Compare it with the configuration of rh-mysql57 stored in/etc/opt/rh/rh-mysql57/my.cnfand/etc/opt/rh/rh-mysql57/my.cnf.d/and adjust it if necessary. - Stop the rh-mysql57 database server, if it is still running.
systemctl stop rh-mysql57-mysqld.service
systemctl stop rh-mysql57-mysqld.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow - All data of the rh-mysql57 Software Collection is stored in the
/var/opt/rh/rh-mysql57/lib/mysql/directory. Copy the whole content of this directory to/var/opt/rh/rh-mysql80/lib/mysql/. You can also move the content but remember to back up your data before you continue to upgrade. - Start the rh-mysql80 database server.
systemctl start rh-mysql80-mysqld.service
systemctl start rh-mysql80-mysqld.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Perform the data migration.
scl enable rh-mysql80 mysql_upgrade
scl enable rh-mysql80 mysql_upgradeCopy to Clipboard Copied! Toggle word wrap Toggle overflow If therootuser has a non-empty password defined (it should have a password defined), it is necessary to call the mysql_upgrade utility with the-poption and specify the password.scl enable rh-mysql80 -- mysql_upgrade -p
scl enable rh-mysql80 -- mysql_upgrade -pCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note that when the rh-mysql80*-syspaths packages are installed, thescl enablecommand is not required. However, the *-syspaths packages conflict with the corresponding packages from the base Red Hat Enterprise Linux system and from the rh-mariadb102 and rh-mariadb103 Software Collections.
5.3. Migrating to MongoDB 3.6 Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Red Hat Software Collections 3.6 is released with MongoDB 3.6, provided by the rh-mongodb36 Software Collection and available only for Red Hat Enterprise Linux 7.
The rh-mongodb36 Software Collection includes the rh-mongodb36-syspaths package, which installs packages that provide system-wide wrappers for binaries, scripts, manual pages, and other. After installing the rh-mongodb36*-syspaths packages, users are not required to use the
scl enable command for correct functioning of the binaries and scripts provided by the rh-mongodb36* packages. To find out more about syspaths, see the Red Hat Software Collections Packaging Guide.
5.3.1. Notable Differences Between MongoDB 3.4 and MongoDB 3.6 Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
General Changes
The rh-mongodb36 Software Collection introduces the following significant general change:
- On Non-Uniform Access Memory (NUMA) hardware, it is possible to configure
systemdservices to be launched using thenumactlcommand; see the upstream recommendation. To use MongoDB with thenumactlcommand, you need to install the numactl RPM package and change the/etc/opt/rh/rh-mongodb36/sysconfig/mongodand/etc/opt/rh/rh-mongodb36/sysconfig/mongosconfiguration files accordingly.
Compatibility Changes
MongoDB 3.6 includes various minor changes that can affect compatibility with previous versions of MongoDB:
- MongoDB binaries now bind to
localhostby default, so listening on different IP addresses needs to be explicitly enabled. Note that this is already the default behavior forsystemdservices distributed with MongoDB Software Collections. - The MONGODB-CR authentication mechanism has been deprecated. For databases with users created by MongoDB versions earlier than 3.0, upgrade authentication schema to SCRAM.
- The HTTP interface and REST API have been removed
- Arbiters in replica sets have priority
0 - Master-slave replication has been deprecated
For detailed compatibility changes in MongoDB 3.6, see the upstream release notes.
Backwards Incompatible Features
The following MongoDB 3.6 features are backwards incompatible and require the version to be set to 3.6 using the
featureCompatibilityVersion command:
- UUID for collections
$jsonSchemadocument validation- Change streams
- Chunk aware secondaries
- View definitions, document validators, and partial index filters that use version 3.6 query features
- Sessions and retryable writes
- Users and roles with
authenticationRestrictions
For details regarding backward incompatible changes in MongoDB 3.6, see the upstream release notes.
5.3.2. Upgrading from the rh-mongodb34 to the rh-mongodb36 Software Collection Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Important
Before migrating from the rh-mongodb34 to the rh-mongodb36 Software Collection, back up all your data, including any MongoDB databases, which are by default stored in the
/var/opt/rh/rh-mongodb34/lib/mongodb/ directory. In addition, see the Compatibility Changes to ensure that your applications and deployments are compatible with MongoDB 3.6.
To upgrade to the rh-mongodb36 Software Collection, perform the following steps.
- To be able to upgrade, the rh-mongodb34 instance must have
featureCompatibilityVersionset to3.4. CheckfeatureCompatibilityVersion:scl enable rh-mongodb34 'mongo --host localhost --port 27017 admin' --eval 'db.adminCommand({getParameter: 1, featureCompatibilityVersion: 1})'~]$ scl enable rh-mongodb34 'mongo --host localhost --port 27017 admin' --eval 'db.adminCommand({getParameter: 1, featureCompatibilityVersion: 1})'Copy to Clipboard Copied! Toggle word wrap Toggle overflow If themongodserver is configured with enabled access control, add the--usernameand--passwordoptions to themongocommand. - Install the MongoDB servers and shells from the rh-mongodb36 Software Collections:
yum install rh-mongodb36
~]# yum install rh-mongodb36Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Stop the MongoDB 3.4 server:
systemctl stop rh-mongodb34-mongod.service
~]# systemctl stop rh-mongodb34-mongod.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy your data to the new location:
cp -a /var/opt/rh/rh-mongodb34/lib/mongodb/* /var/opt/rh/rh-mongodb36/lib/mongodb/
~]# cp -a /var/opt/rh/rh-mongodb34/lib/mongodb/* /var/opt/rh/rh-mongodb36/lib/mongodb/Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Configure the
rh-mongodb36-mongoddaemon in the/etc/opt/rh/rh-mongodb36/mongod.conffile. - Start the MongoDB 3.6 server:
systemctl start rh-mongodb36-mongod.service
~]# systemctl start rh-mongodb36-mongod.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Enable backwards incompatible features:
scl enable rh-mongodb36 'mongo --host localhost --port 27017 admin' --eval 'db.adminCommand( { setFeatureCompatibilityVersion: "3.6" } )'~]$ scl enable rh-mongodb36 'mongo --host localhost --port 27017 admin' --eval 'db.adminCommand( { setFeatureCompatibilityVersion: "3.6" } )'Copy to Clipboard Copied! Toggle word wrap Toggle overflow If themongodserver is configured with enabled access control, add the--usernameand--passwordoptions to themongocommand.Note
After upgrading, it is recommended to run the deployment first without enabling the backwards incompatible features for a burn-in period of time, to minimize the likelihood of a downgrade.
For detailed information about upgrading, see the upstream release notes.
For information about upgrading a Replica Set, see the upstream MongoDB Manual.
For information about upgrading a Sharded Cluster, see the upstream MongoDB Manual.
5.4. Migrating to PostgreSQL 12 Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Red Hat Software Collections 3.6 is distributed with PostgreSQL 12, available only for Red Hat Enterprise Linux 7. The rh-postgresql12 Software Collection can be safely installed on the same machine in parallel with the base Red Hat Enterprise Linux system version of PostgreSQL or any PostgreSQL Software Collection. It is also possible to run more than one version of PostgreSQL on a machine at the same time, but you need to use different ports or IP addresses and adjust SELinux policy.
The rh-postgresql12 Software Collection includes the rh-postgresql12-syspaths package, which installs packages that provide system-wide wrappers for binaries, scripts, manual pages, and other. After installing the rh-postgreqsl12*-syspaths packages, users are not required to use the
scl enable command for correct functioning of the binaries and scripts provided by the rh-postgreqsl12* packages. Note that the *-syspaths packages conflict with the corresponding packages from the base Red Hat Enterprise Linux system. To find out more about syspaths, see the Red Hat Software Collections Packaging Guide.
Important
Before migrating to PostgreSQL 12, see the upstream compatibility notes for PostgreSQL 11 and PostgreSQL 12.
In case of upgrading the PostgreSQL database in a container, see the container-specific instructions.
The following table provides an overview of different paths in a Red Hat Enterprise Linux 7 system version of PostgreSQL provided by the postgresql package, and in the rh-postgresql10 and rh-postgresql12 Software Colections.
| Content | postgresql | rh-postgresql10 | rh-postgresql12 |
|---|---|---|---|
| Executables | /usr/bin/ | /opt/rh/rh-postgresql10/root/usr/bin/ | /opt/rh/rh-postgresql12/root/usr/bin/ |
| Libraries | /usr/lib64/ | /opt/rh/rh-postgresql10/root/usr/lib64/ | /opt/rh/rh-postgresql12/root/usr/lib64/ |
| Documentation | /usr/share/doc/postgresql/html/ | /opt/rh/rh-postgresql10/root/usr/share/doc/postgresql/html/ | /opt/rh/rh-postgresql12/root/usr/share/doc/postgresql/html/ |
| PDF documentation | /usr/share/doc/postgresql-docs/ | /opt/rh/rh-postgresql10/root/usr/share/doc/postgresql-docs/ | /opt/rh/rh-postgresql12/root/usr/share/doc/postgresql-docs/ |
| Contrib documentation | /usr/share/doc/postgresql-contrib/ | /opt/rh/rh-postgresql10/root/usr/share/doc/postgresql-contrib/ | /opt/rh/rh-postgresql12/root/usr/share/doc/postgresql-contrib/ |
| Source | not installed | not installed | not installed |
| Data | /var/lib/pgsql/data/ | /var/opt/rh/rh-postgresql10/lib/pgsql/data/ | /var/opt/rh/rh-postgresql12/lib/pgsql/data/ |
| Backup area | /var/lib/pgsql/backups/ | /var/opt/rh/rh-postgresql10/lib/pgsql/backups/ | /var/opt/rh/rh-postgresql12/lib/pgsql/backups/ |
| Templates | /usr/share/pgsql/ | /opt/rh/rh-postgresql10/root/usr/share/pgsql/ | /opt/rh/rh-postgresql12/root/usr/share/pgsql/ |
| Procedural Languages | /usr/lib64/pgsql/ | /opt/rh/rh-postgresql10/root/usr/lib64/pgsql/ | /opt/rh/rh-postgresql12/root/usr/lib64/pgsql/ |
| Development Headers | /usr/include/pgsql/ | /opt/rh/rh-postgresql10/root/usr/include/pgsql/ | /opt/rh/rh-postgresql12/root/usr/include/pgsql/ |
| Other shared data | /usr/share/pgsql/ | /opt/rh/rh-postgresql10/root/usr/share/pgsql/ | /opt/rh/rh-postgresql12/root/usr/share/pgsql/ |
| Regression tests | /usr/lib64/pgsql/test/regress/ (in the -test package) | /opt/rh/rh-postgresql10/root/usr/lib64/pgsql/test/regress/ (in the -test package) | /opt/rh/rh-postgresql12/root/usr/lib64/pgsql/test/regress/ (in the -test package) |
5.4.1. Migrating from a Red Hat Enterprise Linux System Version of PostgreSQL to the PostgreSQL 12 Software Collection Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Red Hat Enterprise Linux 7 is distributed with PostgreSQL 9.2. To migrate your data from a Red Hat Enterprise Linux system version of PostgreSQL to the rh-postgresql12 Software Collection, you can either perform a fast upgrade using the
pg_upgrade tool (recommended), or dump the database data into a text file with SQL commands and import it in the new database. Note that the second method is usually significantly slower and may require manual fixes; see the PostgreSQL documentation for more information about this upgrade method.
Important
Before migrating your data from a Red Hat Enterprise Linux system version of PostgreSQL to PostgreSQL 12, make sure that you back up all your data, including the PostgreSQL database files, which are by default located in the
/var/lib/pgsql/data/ directory.
Procedure 5.1. Fast Upgrade Using the pg_upgrade Tool
To perform a fast upgrade of your PostgreSQL server, complete the following steps:
- Stop the old PostgreSQL server to ensure that the data is not in an inconsistent state. To do so, type the following at a shell prompt as
root:systemctl stop postgresql.service
systemctl stop postgresql.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow To verify that the server is not running, type:systemctl status postgresql.service
systemctl status postgresql.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Verify that the old directory
/var/lib/pgsql/data/exists:file /var/lib/pgsql/data/
file /var/lib/pgsql/data/Copy to Clipboard Copied! Toggle word wrap Toggle overflow and back up your data. - Verify that the new data directory
/var/opt/rh/rh-postgresql12/lib/pgsql/data/does not exist:file /var/opt/rh/rh-postgresql12/lib/pgsql/data/
file /var/opt/rh/rh-postgresql12/lib/pgsql/data/Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you are running a fresh installation of PostgreSQL 12, this directory should not be present in your system. If it is, back it up by running the following command asroot:mv /var/opt/rh/rh-postgresql12/lib/pgsql/data{,-scl-backup}mv /var/opt/rh/rh-postgresql12/lib/pgsql/data{,-scl-backup}Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Upgrade the database data for the new server by running the following command as
root:scl enable rh-postgresql12 -- postgresql-setup --upgrade
scl enable rh-postgresql12 -- postgresql-setup --upgradeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can use the/opt/rh/rh-postgresql12/root/usr/bin/postgresql-setup --upgradecommand.Note that you can use the--upgrade-fromoption for upgrade from different versions of PostgreSQL. The list of possible upgrade scenarios is available using the--upgrade-idsoption.It is recommended that you read the resulting/var/lib/pgsql/upgrade_rh-postgresql12-postgresql.loglog file to find out if any problems occurred during the upgrade. - Start the new server as
root:systemctl start rh-postgresql12-postgresql.service
systemctl start rh-postgresql12-postgresql.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow It is also advised that you run theanalyze_new_cluster.shscript as follows:su - postgres -c 'scl enable rh-postgresql12 ~/analyze_new_cluster.sh'
su - postgres -c 'scl enable rh-postgresql12 ~/analyze_new_cluster.sh'Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Optionally, you can configure the PostgreSQL 12 server to start automatically at boot time. To disable the old system PostgreSQL server, type the following command as
root:chkconfig postgresql off
chkconfig postgresql offCopy to Clipboard Copied! Toggle word wrap Toggle overflow To enable the PostgreSQL 12 server, type asroot:chkconfig rh-postgresql12-postgresql on
chkconfig rh-postgresql12-postgresql onCopy to Clipboard Copied! Toggle word wrap Toggle overflow - If your configuration differs from the default one, make sure to update configuration files, especially the
/var/opt/rh/rh-postgresql12/lib/pgsql/data/pg_hba.confconfiguration file. Otherwise only thepostgresuser will be allowed to access the database.
Procedure 5.2. Performing a Dump and Restore Upgrade
To perform a dump and restore upgrade of your PostgreSQL server, complete the following steps:
- Ensure that the old PostgreSQL server is running by typing the following at a shell prompt as
root:systemctl start postgresql.service
systemctl start postgresql.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Dump all data in the PostgreSQL database into a script file. As
root, type:su - postgres -c 'pg_dumpall > ~/pgdump_file.sql'
su - postgres -c 'pg_dumpall > ~/pgdump_file.sql'Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Stop the old server by running the following command as
root:systemctl stop postgresql.service
systemctl stop postgresql.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Initialize the data directory for the new server as
root:scl enable rh-postgresql12 -- postgresql-setup initdb
scl enable rh-postgresql12 -- postgresql-setup initdbCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Start the new server as
root:systemctl start rh-postgresql12-postgresql.service
systemctl start rh-postgresql12-postgresql.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Import data from the previously created SQL file:
su - postgres -c 'scl enable rh-postgresql12 "psql -f ~/pgdump_file.sql postgres"'
su - postgres -c 'scl enable rh-postgresql12 "psql -f ~/pgdump_file.sql postgres"'Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Optionally, you can configure the PostgreSQL 12 server to start automatically at boot time. To disable the old system PostgreSQL server, type the following command as
root:chkconfig postgresql off
chkconfig postgresql offCopy to Clipboard Copied! Toggle word wrap Toggle overflow To enable the PostgreSQL 12 server, type asroot:chkconfig rh-postgresql12-postgresql on
chkconfig rh-postgresql12-postgresql onCopy to Clipboard Copied! Toggle word wrap Toggle overflow - If your configuration differs from the default one, make sure to update configuration files, especially the
/var/opt/rh/rh-postgresql12/lib/pgsql/data/pg_hba.confconfiguration file. Otherwise only thepostgresuser will be allowed to access the database.
5.4.2. Migrating from the PostgreSQL 10 Software Collection to the PostgreSQL 12 Software Collection Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
To migrate your data from the rh-postgresql10 Software Collection to the rh-postgresql12 Collection, you can either perform a fast upgrade using the
pg_upgrade tool (recommended), or dump the database data into a text file with SQL commands and import it in the new database. Note that the second method is usually significantly slower and may require manual fixes; see the PostgreSQL documentation for more information about this upgrade method.
Important
Before migrating your data from PostgreSQL 10 to PostgreSQL 12, make sure that you back up all your data, including the PostgreSQL database files, which are by default located in the
/var/opt/rh/rh-postgresql10/lib/pgsql/data/ directory.
Procedure 5.3. Fast Upgrade Using the pg_upgrade Tool
To perform a fast upgrade of your PostgreSQL server, complete the following steps:
- Stop the old PostgreSQL server to ensure that the data is not in an inconsistent state. To do so, type the following at a shell prompt as
root:systemctl stop rh-postgresql10-postgresql.service
systemctl stop rh-postgresql10-postgresql.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow To verify that the server is not running, type:systemctl status rh-postgresql10-postgresql.service
systemctl status rh-postgresql10-postgresql.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Verify that the old directory
/var/opt/rh/rh-postgresql10/lib/pgsql/data/exists:file /var/opt/rh/rh-postgresql10/lib/pgsql/data/
file /var/opt/rh/rh-postgresql10/lib/pgsql/data/Copy to Clipboard Copied! Toggle word wrap Toggle overflow and back up your data. - Verify that the new data directory
/var/opt/rh/rh-postgresql12/lib/pgsql/data/does not exist:file /var/opt/rh/rh-postgresql12/lib/pgsql/data/
file /var/opt/rh/rh-postgresql12/lib/pgsql/data/Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you are running a fresh installation of PostgreSQL 12, this directory should not be present in your system. If it is, back it up by running the following command asroot:mv /var/opt/rh/rh-postgresql12/lib/pgsql/data{,-scl-backup}mv /var/opt/rh/rh-postgresql12/lib/pgsql/data{,-scl-backup}Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Upgrade the database data for the new server by running the following command as
root:scl enable rh-postgresql12 -- postgresql-setup --upgrade --upgrade-from=rh-postgresql10-postgresql
scl enable rh-postgresql12 -- postgresql-setup --upgrade --upgrade-from=rh-postgresql10-postgresqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can use the/opt/rh/rh-postgresql12/root/usr/bin/postgresql-setup --upgrade --upgrade-from=rh-postgresql10-postgresqlcommand.Note that you can use the--upgrade-fromoption for upgrading from different versions of PostgreSQL. The list of possible upgrade scenarios is available using the--upgrade-idsoption.It is recommended that you read the resulting/var/lib/pgsql/upgrade_rh-postgresql12-postgresql.loglog file to find out if any problems occurred during the upgrade. - Start the new server as
root:systemctl start rh-postgresql12-postgresql.service
systemctl start rh-postgresql12-postgresql.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow It is also advised that you run theanalyze_new_cluster.shscript as follows:su - postgres -c 'scl enable rh-postgresql12 ~/analyze_new_cluster.sh'
su - postgres -c 'scl enable rh-postgresql12 ~/analyze_new_cluster.sh'Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Optionally, you can configure the PostgreSQL 12 server to start automatically at boot time. To disable the old PostgreSQL 10 server, type the following command as
root:chkconfig rh-postgresql10-postgreqsql off
chkconfig rh-postgresql10-postgreqsql offCopy to Clipboard Copied! Toggle word wrap Toggle overflow To enable the PostgreSQL 12 server, type asroot:chkconfig rh-postgresql12-postgresql on
chkconfig rh-postgresql12-postgresql onCopy to Clipboard Copied! Toggle word wrap Toggle overflow - If your configuration differs from the default one, make sure to update configuration files, especially the
/var/opt/rh/rh-postgresql12/lib/pgsql/data/pg_hba.confconfiguration file. Otherwise only thepostgresuser will be allowed to access the database.
Procedure 5.4. Performing a Dump and Restore Upgrade
To perform a dump and restore upgrade of your PostgreSQL server, complete the following steps:
- Ensure that the old PostgreSQL server is running by typing the following at a shell prompt as
root:systemctl start rh-postgresql10-postgresql.service
systemctl start rh-postgresql10-postgresql.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Dump all data in the PostgreSQL database into a script file. As
root, type:su - postgres -c 'scl enable rh-postgresql10 "pg_dumpall > ~/pgdump_file.sql"'
su - postgres -c 'scl enable rh-postgresql10 "pg_dumpall > ~/pgdump_file.sql"'Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Stop the old server by running the following command as
root:systemctl stop rh-postgresql10-postgresql.service
systemctl stop rh-postgresql10-postgresql.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Initialize the data directory for the new server as
root:scl enable rh-postgresql12 -- postgresql-setup initdb
scl enable rh-postgresql12 -- postgresql-setup initdbCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Start the new server as
root:systemctl start rh-postgresql12-postgresql.service
systemctl start rh-postgresql12-postgresql.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Import data from the previously created SQL file:
su - postgres -c 'scl enable rh-postgresql12 "psql -f ~/pgdump_file.sql postgres"'
su - postgres -c 'scl enable rh-postgresql12 "psql -f ~/pgdump_file.sql postgres"'Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Optionally, you can configure the PostgreSQL 12 server to start automatically at boot time. To disable the old PostgreSQL 10 server, type the following command as
root:chkconfig rh-postgresql10-postgresql off
chkconfig rh-postgresql10-postgresql offCopy to Clipboard Copied! Toggle word wrap Toggle overflow To enable the PostgreSQL 12 server, type asroot:chkconfig rh-postgresql12-postgresql on
chkconfig rh-postgresql12-postgresql onCopy to Clipboard Copied! Toggle word wrap Toggle overflow - If your configuration differs from the default one, make sure to update configuration files, especially the
/var/opt/rh/rh-postgresql12/lib/pgsql/data/pg_hba.confconfiguration file. Otherwise only thepostgresuser will be allowed to access the database.
5.5. Migrating to nginx 1.18 Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
The root directory for the rh-nginx118 Software Collection is located in
/opt/rh/rh-nginx118/root/. The error log is stored in /var/opt/rh/rh-nginx118/log/nginx by default.
Configuration files are stored in the
/etc/opt/rh/rh-nginx118/nginx/ directory. Configuration files in nginx 1.18 have the same syntax and largely the same format as previous nginx Software Collections.
Configuration files (with a
.conf extension) in the /etc/opt/rh/rh-nginx118/nginx/default.d/ directory are included in the default server block configuration for port 80.
Important
Before upgrading from nginx 1.16 to nginx 1.18, back up all your data, including web pages located in the
/opt/rh/nginx116/root/ tree and configuration files located in the /etc/opt/rh/nginx116/nginx/ tree.
If you have made any specific changes, such as changing configuration files or setting up web applications, in the
/opt/rh/nginx116/root/ tree, replicate those changes in the new /opt/rh/rh-nginx118/root/ and /etc/opt/rh/rh-nginx118/nginx/ directories, too.
You can use this procedure to upgrade directly from nginx 1.12 or nginx 1.14 to nginx 1.18. Use the appropriate paths in this case.
For the official nginx documentation, refer to http://nginx.org/en/docs/.
5.6. Migrating to Redis 5 Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Redis 3.2, provided by the rh-redis32 Software Collection, is mostly a strict subset of Redis 4.0, which is mostly a strict subset of Redis 5.0. Therefore, no major issues should occur when upgrading from version 3.2 to version 5.0.
To upgrade a Redis Cluster to version 5.0, a mass restart of all the instances is needed.
Compatibility Notes
- The format of RDB files has been changed. Redis 5 is able to read formats of all the earlier versions, but earlier versions are incapable of reading the Redis 5 format.
- Since version 4.0, the Redis Cluster bus protocol is no longer compatible with Redis 3.2.
- For minor non-backward compatible changes, see the upstream release notes for version 4.0 and version 5.0.