Questo contenuto non è disponibile nella lingua selezionata.
Chapter 5. Migration
5.1. Migrating to MariaDB 10.1 Copia collegamentoCollegamento copiato negli appunti!
my.cnf files need to be changed to prevent these specific resources from conflicting. Additionally, it is possible to install the rh-mariadb101 Software Collection while the rh-mariadb100 Collection is still installed and even running.
Note
scl register command.
5.1.1. Notable Differences Between the mariadb100 and rh-mariadb101 Software Collections Copia collegamentoCollegamento copiato negli appunti!
- Galera Cluster, a synchronous multi-master cluster, which is a standard part of MariaDB 10.1. See the Knowledgebase article about setting up Galera Cluster with the rh-mariadb101 Software Collection.
- Since MariaDB 10.1.7, the
SQL_MODEvariable is by default set toNO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USERwhile in earlier versions of MariaDB no default was set. Consequently, theGRANTstatement does not create a user by default. The setting of theSQL_MODEvariable can be changed in the configuration file. See the upstream documentation for details.
5.1.2. Upgrading from the rh-mariadb100 to the rh-mariadb101 Software Collection Copia collegamentoCollegamento copiato negli appunti!
Important
- Install the rh-mariadb101 Software Collection.
yum install rh-mariadb101-mariadb-server
yum install rh-mariadb101-mariadb-serverCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Inspect the configuration of rh-mariadb101, which is stored in the
/etc/opt/rh/rh-mariadb101/my.cnffile and the/etc/opt/rh/rh-mariadb101/my.cnf.d/directory. Compare it with the configuration of rh-mariadb100 stored in/etc/opt/rh/rh-mariadb100/my.cnfand/etc/opt/rh/rh-mariadb100/my.cnf.d/and adjust it if necessary. - Stop the rh-mariadb100 database server, if it is still running.
service rh-mariadb100-mariadb stop
service rh-mariadb100-mariadb stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow - All the data of the rh-mariadb100 Software Collection is stored in the
/var/opt/rh/rh-mariadb100/lib/mysql/directory. Copy the whole content of this directory to/var/opt/rh/rh-mariadb101/lib/mysql/. You can also move the content but remember to back up your data before you continue to upgrade. - Start the rh-mariadb101 database server.
service rh-mariadb101-mariadb start
service rh-mariadb101-mariadb startCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Perform the data migration.
scl enable rh-mariadb101 mysql_upgrade
scl enable rh-mariadb101 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-mariadb101 -- mysql_upgrade -p
scl enable rh-mariadb101 -- mysql_upgrade -pCopy to Clipboard Copied! Toggle word wrap Toggle overflow
5.2. Migrating to MongoDB 3.2 Copia collegamentoCollegamento copiato negli appunti!
5.2.1. Notable Differences Between MongoDB 2.6 and MongoDB 3.2 Copia collegamentoCollegamento copiato negli appunti!
General Changes
- MongoDB now ships configuration files in the YAML format
- MongoDB server and tools are no longer shipped in a single package; MongoDB tools are packaged in rh-mongodb32-mongo-tools
- Improved MongoDB testsuite provided by the rh-mongodb32-mongodb-test package. For more information about usage, install this package and read the
/opt/rh/rh-mongodb32/root/usr/share/mongodb-test/READMEfile.
Compatibility Changes
Compatibility Changes in MongoDB 3.0
- Configuration file options changes due to inclusion of additional storage engines
- Data files must correspond to the configured storage engine; if files in the
dbPathdirectory were created by a storage engine other than the current one, an error is returned - Changes due to using the WiredTiger storage engine:
oplogentries generated by versions of MongoDB earlier than 2.2.1 are overwritten - Replica set configuration validation
- The
w:majoritysemantics has been changed so that thew:majorityvalue is satisfied when a majority of the voting members replicates a write operation - The
local.slavescollection has been removed - The FATAL replica set state no longer exists
- The
mongodump,mongorestore,mongoexport,mongoimport,mongofiles, andmongooplogtools must connect to a running MongoDB instance - The MongoDB 2.4 user model has been removed
- The localhost exception has been changed so that it allows to create only the first user on the admin database
- The
db.addUser()function has been removed; usedb.createUser()anddb.updateUser()instead - TLS/SSL changes
- The
mongoshell versions earlier than 3.0 are not compatible with 3.0 deployments of MongoDB - Index changes
- Direct access to the
system.indexesandsystem.namespacescollections has been deprecated - The following commands have been deprecated:
closeAllDatabases,getoptime,text,indexStats,db.collection.getIndexStats(), anddb.collection.indexStats() - The
DateandTimestampdata types are no longer equivalent for comparison purposes
Compatibility Changes in MongoDB 3.2
- The WiredTiger storage engine is now the default one
- The JavaScript engine has been changed from V8 to SpiderMonkey
- Creation of version 0 indexes is now disallowed
- Aggregation compatibility changes
5.2.2. Upgrading from the rh-mongodb26 to the rh-mongodb32 Software Collection Copia collegamentoCollegamento copiato negli appunti!
Important
/var/opt/rh/rh-mongodb26/lib/mongodb/ directory.
- Install the MongoDB servers and shells from the rh-mongodb30upg and rh-mongodb32 Software Collections:
yum install rh-mongodb30upg rh-mongodb30upg-mongodb rh-mongodb32 rh-mongodb32-mongodb
~]# yum install rh-mongodb30upg rh-mongodb30upg-mongodb rh-mongodb32 rh-mongodb32-mongodbCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Connect the
mongoshell from the rh-mongodb26 Collection to your MongoDB 2.6 server (for example, running onlocalhost, port27017).scl enable rh-mongodb26 'mongo --host localhost --port 27017 admin'
~]$ scl enable rh-mongodb26 'mongo --host localhost --port 27017 admin'Copy to Clipboard Copied! Toggle word wrap Toggle overflow - In the
mongoshell, check your data set for compatibility issues mentioned above and fix the ones that affect your application. - Stop the MongoDB 2.6 server:
systemctl stop rh-mongodb26-mongod.service
~]# systemctl stop rh-mongodb26-mongod.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use theservice rh-mongodb26-mongodb stopcommand if you are using Red Hat Enterprise Linux 6. - Copy your data to the new location:
cp -a /var/opt/rh/rh-mongodb26/lib/mongodb/* /var/opt/rh/rh-mongodb32/lib/mongodb
~]# cp -a /var/opt/rh/rh-mongodb26/lib/mongodb/* /var/opt/rh/rh-mongodb32/lib/mongodbCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Change the
dbpathvariable in the/etc/opt/rh/rh-mongodb30upg/mongod.conffile to/var/opt/rh/rh-mongodb32/lib/mongodb/. - Start the MongoDB server from the rh-mongodb30upg Software Collection:
systemctl start rh-mongodb30upg-mongod.service
~]# systemctl start rh-mongodb30upg-mongod.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use theservice rh-mongodb30upg-mongodb startcommand if you are using Red Hat Enterprise Linux 6. - Connect the
mongoshell from the rh-mongodb32 Collection to your MongoDB 3.0 server (for example, running onlocalhost, port27017).scl enable rh-mongodb30upg 'mongo --host localhost --port 27017 admin'
~]$ scl enable rh-mongodb30upg 'mongo --host localhost --port 27017 admin'Copy to Clipboard Copied! Toggle word wrap Toggle overflow - In the
mongoshell, check your data set for compatibility issues mentioned above and fix the ones that affect your application. - Stop the MongoDB 3.0 server.
systemctl stop rh-mongodb30upg-mongod.service
~]# systemctl stop rh-mongodb30upg-mongod.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use theservice rh-mongodb30upg-mongodb stopcommand if you are using Red Hat Enterprise Linux 6. - Configure the
rh-mongodb32-mongoddaemon in the/etc/opt/rh/rh-mongodb32/mongod.conffile. - MongoDB 3.2 has the new default storage engine, WiredTiger, which introduces performance improvements. To be able to run the MongoDB server with old data, configure the
rh-mongodb32-mongoddaemon to use the old storage engine. Uncomment theengineproperty in thestoragesection in the/etc/opt/rh/rh-mongodb32/mongod.conffile and change its value tommapv1. - Start the MongoDB 3.2 server.
systemctl start rh-mongodb32-mongod.service
~]# systemctl start rh-mongodb32-mongod.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use theservice rh-mongodb32-mongodb startcommand if you are using Red Hat Enterprise Linux 6. - If you want to use the WiredTiger storage engine, you have to perform additional migration steps described in the MongoDB documentation.
yum install rh-mongodb32-mongo-tools scl enable rh-mongodb32 'mongodump --out ~/mongodb.dump' systemctl stop rh-mongodb32-mongod.service rm -rf /var/opt/rh/rh-mongodb32/lib/mongodb/*
~]# yum install rh-mongodb32-mongo-tools ~]$ scl enable rh-mongodb32 'mongodump --out ~/mongodb.dump' ~]# systemctl stop rh-mongodb32-mongod.service ~]# rm -rf /var/opt/rh/rh-mongodb32/lib/mongodb/*Copy to Clipboard Copied! Toggle word wrap Toggle overflow Change theengineproperty in the/etc/opt/rh/rh-mongodb32/mongod.conftowiredTiger. Use theservice rh-mongodb32-mongodb stopcommand if you are using Red Hat Enterprise Linux 6.systemctl start rh-mongodb32-mongod.service scl enable rh-mongodb32 'mongorestore ~/mongodb.dump'
~]# systemctl start rh-mongodb32-mongod.service ~]$ scl enable rh-mongodb32 'mongorestore ~/mongodb.dump'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use theservice rh-mongodb32-mongodb startcommand if you are using Red Hat Enterprise Linux 6.
5.3. Migrating to MySQL 5.7 Copia collegamentoCollegamento copiato negli appunti!
my.cnf files need to be changed to prevent these specific resources from conflicting.
5.3.1. Notable Differences Between MySQL 5.6 and MySQL 5.7 Copia collegamentoCollegamento copiato negli appunti!
- The mysql-bench subpackage is not included in the rh-mysql57 Software Collection.
- Since MySQL 5.7.7, the default SQL mode includes
NO_AUTO_CREATE_USER. Therefore it is necessary to create MySQL accounts using theCREATE USERstatement because theGRANTstatement no longer creates a user by default. See the upstream documentation for details.
5.3.2. Upgrading to the rh-mysql57 Software Collection Copia collegamentoCollegamento copiato negli appunti!
Important
- Install the rh-mysql57 Software Collection.
yum install rh-mysql57-mysql-server
yum install rh-mysql57-mysql-serverCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Inspect the configuration of rh-mysql57, which is stored in the
/etc/opt/rh/rh-mysql57/my.cnffile and the/etc/opt/rh/rh-mysql57/my.cnf.d/directory. Compare it with the configuration of rh-mysql56 stored in/etc/opt/rh/rh-mysql56/my.cnfand/etc/opt/rh/rh-mysql56/my.cnf.d/and adjust it if necessary. - Stop the rh-mysql56 database server, if it is still running.
service rh-mysql56-mysqld stop
service rh-mysql56-mysqld stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow - All data of the rh-mysql56 Software Collection is stored in the
/var/opt/rh/rh-mysql56/lib/mysql/directory. Copy the whole content of this directory to/var/opt/rh/rh-mysql57/lib/mysql/. You can also move the content but remember to back up your data before you continue to upgrade. - Start the rh-mysql57 database server.
service rh-mysql57-mysqld start
service rh-mysql57-mysqld startCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Perform the data migration.
scl enable rh-mysql57 mysql_upgrade
scl enable rh-mysql57 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-mysql57 -- mysql_upgrade -p
scl enable rh-mysql57 -- mysql_upgrade -pCopy to Clipboard Copied! Toggle word wrap Toggle overflow
5.4. Migrating to PostgreSQL 9.5 Copia collegamentoCollegamento copiato negli appunti!
5.4.1. Notable Differences Between PostgreSQL 9.4 and PostgreSQL 9.5 Copia collegamentoCollegamento copiato negli appunti!
| Content | postgresql | postgresql92 | rh-postgresql94 | rh-postgresql95 |
|---|---|---|---|---|
| Executables | /usr/bin/ | /opt/rh/postgresql92/root/usr/bin/ | /opt/rh/rh-postgresql94/root/usr/bin/ | /opt/rh/rh-postgresql95/root/usr/bin/ |
| Libraries | /usr/lib64/ | /opt/rh/postgresql92/root/usr/lib64/ | /opt/rh/rh-postgresql94/root/usr/lib64/ | /opt/rh/rh-postgresql95/root/usr/lib64/ |
| Documentation | /usr/share/doc/postgresql/html/ | /opt/rh/postgresql92/root/usr/share/doc/postgresql/html/ | /opt/rh/rh-postgresql94/root/usr/share/doc/postgresql/html/ | /opt/rh/rh-postgresql95/root/usr/share/doc/postgresql/html/ |
| PDF documentation | /usr/share/doc/postgresql-docs/ | /opt/rh/postgresql92/root/usr/share/doc/postgresql-docs/ | /opt/rh/rh-postgresql94/root/usr/share/doc/postgresql-docs/ | /opt/rh/rh-postgresql95/root/usr/share/doc/postgresql-docs/ |
| Contrib documentation | /usr/share/doc/postgresql-contrib/ | /opt/rh/postgresql92/root/usr/share/doc/postgresql-contrib/ | /opt/rh/rh-postgresql94/root/usr/share/doc/postgresql-contrib/ | /opt/rh/rh-postgresql95/root/usr/share/doc/postgresql-contrib/ |
| Source | not installed | not installed | not installed | not installed |
| Data | /var/lib/pgsql/data/ | /opt/rh/postgresql92/root/var/lib/pgsql/data/ | /var/opt/rh/rh-postgresql94/lib/pgsql/data/ | /var/opt/rh/rh-postgresql95/lib/pgsql/data/ |
| Backup area | /var/lib/pgsql/backups/ | /opt/rh/postgresql92/root/var/lib/pgsql/backups/ | /var/opt/rh/rh-postgresql94/lib/pgsql/backups/ | /var/opt/rh/rh-postgresql95/lib/pgsql/backups/ |
| Templates | /usr/share/pgsql/ | /opt/rh/postgresql92/root/usr/share/pgsql/ | /opt/rh/rh-postgresql94/root/usr/share/pgsql/ | /opt/rh/rh-postgresql95/root/usr/share/pgsql/ |
| Procedural Languages | /usr/lib64/pgsql/ | /opt/rh/postgresql92/root/usr/lib64/pgsql/ | /opt/rh/rh-postgresql94/root/usr/lib64/pgsql/ | /opt/rh/rh-postgresql95/root/usr/lib64/pgsql/ |
| Development Headers | /usr/include/pgsql/ | /opt/rh/postgresql92/root/usr/include/pgsql/ | /opt/rh/rh-postgresql94/root/usr/include/pgsql/ | /opt/rh/rh-postgresql95/root/usr/include/pgsql/ |
| Other shared data | /usr/share/pgsql/ | /opt/rh/postgresql92/root/usr/share/pgsql/ | /opt/rh/rh-postgresql94/root/usr/share/pgsql/ | /opt/rh/rh-postgresql95/root/usr/share/pgsql/ |
| Regression tests | /usr/lib64/pgsql/test/regress/ (in the -test package) | /opt/rh/postgresql92/root/usr/lib64/pgsql/test/regress/ (in the -test package) | /opt/rh/rh-postgresql94/root/usr/lib64/pgsql/test/regress/ (in the -test package) | /opt/rh/rh-postgresql95/root/usr/lib64/pgsql/test/regress/ (in the -test package) |
5.4.2. Migrating from a Red Hat Enterprise Linux System Version of PostgreSQL to the PostgreSQL 9.5 Software Collection Copia collegamentoCollegamento copiato negli appunti!
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. The following procedures are applicable for both Red Hat Enterprise Linux 6 and Red Hat Enterprise Linux 7 system versions of PostgreSQL.
Important
/var/lib/pgsql/data/ directory.
Procedure 5.1. Fast Upgrade Using the pg_upgrade Tool
- 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:service postgresql stop
service postgresql stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow To verify that the server is not running, type:service postgresql status
service postgresql statusCopy 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-postgresql95/lib/pgsql/data/does not exist:file /var/opt/rh/rh-postgresql95/lib/pgsql/data/
file /var/opt/rh/rh-postgresql95/lib/pgsql/data/Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you are running a fresh installation of PostgreSQL 9.5, 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-postgresql95/lib/pgsql/data{,-scl-backup}mv /var/opt/rh/rh-postgresql95/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-postgresql95 -- postgresql-setup --upgrade
scl enable rh-postgresql95 -- postgresql-setup --upgradeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can use the/opt/rh/rh-postgresql95/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-postgresql95-postgresql.loglog file to find out if any problems occurred during the upgrade. - Start the new server as
root:service rh-postgresql95-postgresql start
service rh-postgresql95-postgresql startCopy 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-postgresql95 ~/analyze_new_cluster.sh'
su - postgres -c 'scl enable rh-postgresql95 ~/analyze_new_cluster.sh'Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Optionally, you can configure the PostgreSQL 9.5 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 9.5 server, type asroot:chkconfig rh-postgresql95-postgresql on
chkconfig rh-postgresql95-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-postgresql95/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
- Ensure that the old PostgreSQL server is running by typing the following at a shell prompt as
root:service postgresql start
service postgresql startCopy 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:service postgresql stop
service postgresql stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Initialize the data directory for the new server as
root:scl enable rh-postgresql95-postgresql -- postgresql-setup --initdb
scl enable rh-postgresql95-postgresql -- postgresql-setup --initdbCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Start the new server as
root:service rh-postgresql95-postgresql start
service rh-postgresql95-postgresql startCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Import data from the previously created SQL file:
su - postgres -c 'scl enable rh-postgresql95 "psql -f ~/pgdump_file.sql postgres"'
su - postgres -c 'scl enable rh-postgresql95 "psql -f ~/pgdump_file.sql postgres"'Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Optionally, you can configure the PostgreSQL 9.5 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 9.5 server, type asroot:chkconfig rh-postgresql95-postgresql on
chkconfig rh-postgresql95-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-postgresql95/lib/pgsql/data/pg_hba.confconfiguration file. Otherwise only thepostgresuser will be allowed to access the database.
5.4.3. Migrating from the PostgreSQL 9.4 Software Collection to the PostgreSQL 9.5 Software Collection Copia collegamentoCollegamento copiato negli appunti!
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
/var/opt/rh/rh-postgresql94/lib/pgsql/data/ directory.
Procedure 5.3. Fast Upgrade Using the pg_upgrade Tool
- 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:service rh-postgresql94-postgresql stop
service rh-postgresql94-postgresql stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow To verify that the server is not running, type:service rh-postgresql94-postgresql status
service rh-postgresql94-postgresql statusCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Verify that the old directory
/var/opt/rh/rh-postgresql94/lib/pgsql/data/exists:file /var/opt/rh/rh-postgresql94/lib/pgsql/data/
file /var/opt/rh/rh-postgresql94/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-postgresql95/lib/pgsql/data/does not exist:file /var/opt/rh/rh-postgresql95/lib/pgsql/data/
file /var/opt/rh/rh-postgresql95/lib/pgsql/data/Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you are running a fresh installation of PostgreSQL 9.5, 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-postgresql95/lib/pgsql/data{,-scl-backup}mv /var/opt/rh/rh-postgresql95/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-postgresql95 -- postgresql-setup --upgrade --upgrade-from=rh-postgresql94-postgresql
scl enable rh-postgresql95 -- postgresql-setup --upgrade --upgrade-from=rh-postgresql94-postgresqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can use the/opt/rh/rh-postgresql95/root/usr/bin/postgresql-setup --upgrade --upgrade-from=rh-postgresql94-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-postgresql95-postgresql.loglog file to find out if any problems occurred during the upgrade. - Start the new server as
root:service rh-postgresql95-postgresql start
service rh-postgresql95-postgresql startCopy 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-postgresql95 ~/analyze_new_cluster.sh'
su - postgres -c 'scl enable rh-postgresql95 ~/analyze_new_cluster.sh'Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Optionally, you can configure the PostgreSQL 9.5 server to start automatically at boot time. To disable the old PostgreSQL 9.4 server, type the following command as
root:chkconfig rh-postgresql94-postgreqsql off
chkconfig rh-postgresql94-postgreqsql offCopy to Clipboard Copied! Toggle word wrap Toggle overflow To enable the PostgreSQL 9.5 server, type asroot:chkconfig rh-postgresql95-postgresql on
chkconfig rh-postgresql95-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-postgresql95/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
- Ensure that the old PostgreSQL server is running by typing the following at a shell prompt as
root:service rh-postgresql94-postgresql start
service rh-postgresql94-postgresql startCopy 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-postgresql94 "pg_dumpall > ~/pgdump_file.sql"'
su - postgres -c 'scl enable rh-postgresql94 "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:service rh-postgresql94-postgresql stop
service rh-postgresql94-postgresql stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Initialize the data directory for the new server as
root:scl enable rh-postgresql95-postgresql -- postgresql-setup --initdb
scl enable rh-postgresql95-postgresql -- postgresql-setup --initdbCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Start the new server as
root:service rh-postgresql95-postgresql start
service rh-postgresql95-postgresql startCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Import data from the previously created SQL file:
su - postgres -c 'scl enable rh-postgresql95 "psql -f ~/pgdump_file.sql postgres"'
su - postgres -c 'scl enable rh-postgresql95 "psql -f ~/pgdump_file.sql postgres"'Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Optionally, you can configure the PostgreSQL 9.5 server to start automatically at boot time. To disable the old PostgreSQL 9.4 server, type the following command as
root:chkconfig rh-postgresql94-postgresql off
chkconfig rh-postgresql94-postgresql offCopy to Clipboard Copied! Toggle word wrap Toggle overflow To enable the PostgreSQL 9.5 server, type asroot:chkconfig rh-postgresql95-postgresql on
chkconfig rh-postgresql95-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-postgresql95/lib/pgsql/data/pg_hba.confconfiguration file. Otherwise only thepostgresuser will be allowed to access the database.
5.5. Migrating to nginx 1.10 Copia collegamentoCollegamento copiato negli appunti!
/opt/rh/rh-nginx110/root/. The error log is stored in /var/opt/rh/rh-nginx110/log/nginx by default, and the init script is called rh-nginx110-nginx.
/etc/opt/rh/rh-nginx110/nginx/ directory. Configuration files in nginx 1.10 have the same syntax and largely the same format as previous nginx Software Collections, with some minor changes:
- Duplicate
http,mail, andstreamblocks are now disallowed. - Some deprecated directives are no longer supported.
/etc/opt/rh/rh-nginx110/nginx/default.d/, has also been introduced. Configuration files (with a .conf extension) in this directory are included in the default server block configuration for port 80.
Important
/opt/rh/nginx18/root/ tree.
/opt/rh/nginx18/root/ tree, replicate those changes in the new /opt/rh/rh-nginx110/root/ and /etc/opt/rh/rh-nginx110/nginx/ directories, too.