이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 5. Migration
This chapter provides information on migrating to versions of components included in Red Hat Software Collections 2.0.
5.1. Migrating to MariaDB 10.0 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Red Hat Enterprise Linux 6 contains MySQL 5.1 as the default MySQL implementation. Red Hat Enterprise Linux 7 includes MariaDB 5.5 as the default MySQL implementation. MariaDB is a community-developed drop-in replacement for MySQL. In addition to these basic versions, MariaDB 5.5 has been available for Red Hat Enterprise Linux 6 and Red Hat Enterprise Linux 7 as a Software Collection since Red Hat Software Collections 1.0.
The rh-mariadb100 Software Collection available for both Red Hat Enterprise Linux 6 and Red Hat Enterprise Linux 7 does not conflict with the mysql or mariadb packages from the core systems, so it is possible to install the rh-mariadb100 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.
Note that it is possible to upgrade to MariaDB 10.0 only from MariaDB 5.5 or MySQL 5.5. If you need to upgrade from an earlier version, upgrade to MariaDB 5.5 or MySQL 5.5 first. Instructions how to upgrade to MariaDB 5.5 or MySQL 5.5 are available in the Red Hat Software Collections 1.2 Release Notes.
5.1.1. Notable Differences Between the mariadb55 and rh-mariadb100 Software Collections 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
MariaDB 10.0 is built on the MariaDB 5.5 series with backported features from MySQL 5.6 and with entirely new features unavailable elsewhere. The rh-mariadb100 Software Collection introduces the following notable changes:
- The service has been renamed to
rh-mariadb100-mariadbin both Red Hat Enterprise Linux 6 and Red Hat Enterprise Linux 7 - The
testdatabase is no longer created by default - Configuration files for the rh-mariadb100 Software Collection are the
/etc/opt/rh/rh-mariadb100/my.cnffile and in the/etc/opt/rh/rh-mariadb100/my.cnf.d/directory - Variable files including the database files for the rh-mariadb100 Software Collection are located in the
/var/opt/rh/rh-mariadb100/lib/directory - The log file for the MariaDB daemon is
/var/opt/rh/rh-mariadb100/log/mariadb/mariadb.log - The pid file for the daemon is
/var/run/rh-mariadb100-mariadb/mariadb.pid
Note that the rh-mariadb100 Software Collection supports neither mounting over NFS nor dynamical registering using the
scl register command.
For detailed changes, refer to the MariaDB documentation.
If you are going to upgrade from MySQL, refer to the articles about compatibility and features differences.
5.1.2. Upgrading to the rh-mariadb100 Software Collection 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Important
Prior to upgrading, back-up all your data, including any MariaDB or MySQL databases.
Upgrading can be performed either by using the mysqldump and mysqlimport utilities or using an in-place upgrade.
- In the former scenario, the whole dump of all databases from one database is generated and
mysqlis run with the dump file as an input using themysqlimportorLOAD DATA INFILE SQLcommand within the other database. At the same time, the appropriate daemons have to be running during both dumping and restoring. You can use the--all-databasesoption in themysqldumpcall to include all databases in the dump. The--routines,--triggers, and--eventsoptions can also be used if needed. - During the in-place upgrade, the data files are copied from one database directory to another database directory. The daemons must not be running at the time of copying. Set appropriate permissions and SELinux context for the copied files.
After upgrading, start the server and run the
mysql_upgrade command. Running mysql_upgrade is necessary to check and repair internal tables.
In case the
root user has a non-empty password defined (it should have a password defined), it is necessary to call the mysql_upgrade utility with the -p option and specify the password.
Service names and paths bellow depend on which version you are upgrading from.
Example 5.1. Dump and Restore Upgrade
- Create a backup from MariaDB.
- If you are upgrading from MariaDB 5.5 from base Red Hat Enterprise Linux 7:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - If you are upgrading from the mariadb55 Software Collection in Red Hat Enterprise Linux 6:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - For upgrading from the mariadb55 Software Collection in Red Hat Enterprise Linux 7, use
mariadb55-mariadbas the service name. - For upgrading from the mysql55 Software Collection, use
mysql55-mysqldas the service name.
- Import the dumped database into the rh-mariadb100 Software Collection:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Example 5.2. In-place Upgrade from MariaDB 5.5
If you are upgrading from MariaDB 5.5 from base Red Hat Enterprise Linux 7, perform the upgrade as shown in the following example:
For upgrading from the mariadb55 Software Collection{;, use the
/opt/rh/mariadb55/root/var/lib/mysql/ as a source when copying the data.
For upgrading from the mysql55 Software Collection, use the
/opt/rh/mysql55/root/var/lib/mysql/ as a source when copying the data.
For further details, refer to the articles about upgrading from MariaDB 5.5 or upgrading from MySQL 5.5.
5.2. Migrating to MongoDB 2.6 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
MongoDB 2.4 has been available since Red Hat Software Collections 1.1 as the mongodb24 Software Collection. Red Hat Software Collections 2.0 is shipped with MongoDB 2.6 provided by the rh-mongodb26 Software Collection.
5.2.1. Notable Differences Between MongoDB 2.4 and MongoDB 2.6 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
General Changes
The rh-mongodb26 Software Collection introduces several general changes listed below.
- Service files have been renamed:
- The
/etc/rc.d/init.d/mongodb24-mongodbservice file for the MongoDB daemon has been renamed to/etc/rc.d/init.d/rh-mongodb26-mongod - The
/etc/rc.d/init.d/mongodb24-mongodb-shardservice file for the MongoDB sharding server has been renamed to/etc/rc.d/init.d/rh-mongodb26-mongos
- Configuration and system configuration files have been renamed:
- The
mongoddaemon uses the/etc/opt/rh/rh-mongodb26/mongod.confand/etc/opt/rh/rh-mongodb26/sysconfig/mongodconfiguration files - The
mongossharding server uses the/etc/opt/rh/rh-mongodb26/mongos.confand/etc/opt/rh/rh-mongodb26/sysconfig/mongosconfiguration files
- The log files have been relocated:
- The
mongoddaemon now writes log to the/var/opt/rh/rh-mongodb26/log/mongodb/mongod.logfile - The
mongossharding server writes log to the/var/opt/rh/rh-mongodb26/log/mongodb/mongos.logfile
- The default
mongosport number has been changed from27019to27017 - The rh-mongodb26-mongodb-test package, which contains the MongoDB test suite, has been added. For more information about usage, install this package and read the
/opt/rh/rh-mongodb26/root/usr/share/mongodb-test/READMEfile. - The rh-mongodb26 Software Collection supports neither mounting over NFS nor dynamical registering using the
scl registercommand.
Compatibility Changes
MongoDB 2.6 includes various minor changes that can affect compatibility with previous versions of MongoDB. For a brief list of compatibility changes in MongoDB 2.6, refer to the Knowledgebase article on the Red Hat Customer Portal. For details on compatibility changes, see the MongoDB documentation.
Authentication Changes
MongoDB 2.6 authorization model introduces changes in the way MongoDB stores and manages user privilege information:
- MongoDB 2.6 requires at least one user in the
admindatabase with theuserAdminAnyDatabaserole. Make sure that this user exists before you upgrade. - You will not be able to create or modify users or create user-defined roles in MongoDB versions that use previous authorization models.
For details on authentication changes, see the MongoDB documentation.
5.2.2. Upgrading from the mongodb24 to the rh-mongodb26 Software Collection 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Note that once upgraded to MongoDB 2.6, you cannot downgrade to any version earlier than MongoDB 2.4. If you created text or
2dsphere indexes while running MongoDB 2.6, you can downgrade only to MongoDB 2.4.10 or later versions.
Important
Before migrating from the mongodb24 to the rh-mongodb26 Software Collection, back up all your data, including any MongoDB databases, which are by default stored in the
/opt/rh/mongodb24/root/var/lib/mongodb/ directory.
To upgrade to the rh-mongodb26 Software Collection, perform the following steps as
root.
- Install the MongoDB server from the rh-mongodb26 Software Collection:
yum install rh-mongodb26
yum install rh-mongodb26Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Stop the
mongodb24server in Red Hat Enterprise Linux 6:service mongodb24-mongodb stop
service mongodb24-mongodb stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use thesystemctl stop mongodb24-mongodb.servicecommand instead if you are using Red Hat Enterprise Linux 7. - Copy your data into the new location:
cp -a /opt/rh/mongodb24/root/var/lib/mongodb/* /var/opt/rh/rh-mongodb26/lib/mongodb
cp -a /opt/rh/mongodb24/root/var/lib/mongodb/* /var/opt/rh/rh-mongodb26/lib/mongodbCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Change the
dbpathvariable in the/opt/rh/mongodb24/root/etc/mongodb.conffile to/var/opt/rh/rh-mongodb26/lib/mongodb/. - Start the
mongodb24server in Red Hat Enterprise Linux 6:service mongodb24-mongodb start
service mongodb24-mongodb startCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use thesystemctl start mongodb24-mongodb.servicecommand if instead you are using Red Hat Enterprise Linux 7. - Install the
mongoshell from the rh-mongodb26 Software Collection:yum install rh-mongodb26-mongodb
yum install rh-mongodb26-mongodbCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Connect the
mongoshell from the rh-mongodb26 Software Collection to yourmongodb24server (for example, running onlocalhost, port27017; you do not needrootprivileges for this step):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, run thedb.upgradeCheckAllDBs()function to check your data set for compatibility:db.upgradeCheckAllDBs()
db.upgradeCheckAllDBs()Copy to Clipboard Copied! Toggle word wrap Toggle overflow See the MongoDB documentation for more information about thedb.upgradeCheckAllDBs()function. - Resolve all issues identified by
db.upgradeCheckAllDBs()and compatibility issues mentioned above that affect your application. - Stop the
mongodb24server in Red Hat Enterprise Linux 6:service mongodb24-mongodb stop
service mongodb24-mongodb stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use thesystemctl stop mongodb24-mongodb.servicecommand instead if you are using Red Hat Enterprise Linux 7. - Make the mongodb24 Software Collection runnable after the upgrade by changing the
dbpathvariable back to the previous value (/opt/rh/mongodb24/root/var/lib/mongodb/by default) in the/opt/rh/mongodb24/root/etc/mongodb.conffile. - Configure the
rh-mongodb26-mongoddaemon in the/etc/opt/rh/rh-mongodb26/mongod.confconfiguration file. - Start the MongoDB server from the rh-mongodb26 Collection in Red Hat Enterprise Linux 6:
service rh-mongodb26-mongod start
service rh-mongodb26-mongod startCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use thesystemctl start rh-mongodb26-mongod.serviceinstead if you are using Red Hat Enterprise Linux 7. - Upgrade the authorization model as described in the MongoDB documentation. Note that it is recommended to run your MongoDB deployment for a day or two before you upgrade the user authorization model because downgrades are more difficult after the user authorization model has been upgraded. Before you upgrade the authorization model, you will not be able to create or modify users or to use user-defined roles.
For detailed information about upgrading, refer to the MongoDB documentation, or particularly about upgrading a Replica Set or a Sharded Cluster.
5.3. Migrating to MySQL 5.6 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Red Hat Enterprise Linux 6 contains MySQL 5.1 as the default MySQL implementation. Red Hat Enterprise Linux 7 includes MariaDB 5.5 as the default MySQL implementation. In addition to these basic versions, MySQL 5.5 has been available as a Software Collection for Red Hat Enterprise Linux 6 since Red Hat Software Collections 1.0 and for Red Hat Enterprise Linux 7 since Red Hat Software Collections 1.1.
The rh-mysql56 Software Collection available for both Red Hat Enterprise Linux 6 and Red Hat Enterprise Linux 7 does not conflict with the mysql or mariadb packages from the core systems, so it is possible to install the rh-mysql56 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.
Note that it is possible to upgrade to MySQL 5.6 only from MySQL 5.5. If you need to upgrade from an earlier version, upgrade to MySQL 5.5 first. Instructions how to upgrade to MySQL 5.5 are available in the Red Hat Software Collections 1.2 Release Notes.
5.3.1. Notable Differences Between MySQL 5.5 and MySQL 5.6 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The rh-mysql56 Software Collection introduces the following notable changes:
- The service has been renamed to
rh-mysql56-mysqldin both Red Hat Enterprise Linux 6 and Red Hat Enterprise Linux 7 - The
testdatabase is no longer created by default - Configuration files for the rh-mysql56 Software Collection are the
/etc/opt/rh/rh-mysql56/my.cnffile and in the/etc/opt/rh/rh-mysql56/my.cnf.d/directory - Variable files including the database files for the rh-mysql56 Software Collection are located in the
/var/opt/rh/rh-mysql56/lib/directory - The log file for the MySQL daemon is
/var/opt/rh/rh-mysql56/log/mysql/mysqld.log - The pid file for the daemon is
/var/run/rh-mysql56-mysqld/mysqld.pid
Note that the rh-mysql56 Software Collection supports neither mounting over NFS nor dynamical registering using the
scl register command.
For detailed changes, refer to the MySQL documentation.
5.3.2. Upgrading to the rh-mysql56 Software Collection 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Important
Prior to upgrading, back-up all your data, including any MySQL databases.
Upgrading can be performed either by using the mysqldump and mysqlimport utilities or using an in-place upgrade.
- In the former scenario, the whole dump of all databases from one database is generated and
mysqlis run with the dump file as an input using themysqlimportorLOAD DATA INFILE SQLcommand within the other database. At the same time, the appropriate daemons have to be running during both dumping and restoring. You can use the--all-databasesoption in themysqldumpcall to include all databases in the dump. The--routines,--triggers, and--eventsoptions can also be used if needed. - During the in-place upgrade, the data files are copied from one database directory to another database directory. The daemons must not be running at the time of copying. Set appropriate permissions and SELinux context for the copied files.
After upgrading, start the server and run the
mysql_upgrade command. Running mysql_upgrade is necessary to check and repair internal tables.
In case the
root user has a non-empty password defined (it should have a password defined), it is necessary to call the mysql_upgrade utility with the -p option and specify the password.
Service names and paths bellow depend on which version you are upgrading from.
Example 5.3. Dump and Restore Upgrade
- Create a backup from the mysql55 Software Collection:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For upgrading from the mariadb55 Software Collection in Red Hat Enterprise Linux 6, usemariadb55-mysqldas the service name.For upgrading from the mariadb55 Software Collection in Red Hat Enterprise Linux 7, usemariadb55-mariadbas the service name.For upgrading from MariaDB 5.5 from base Red Hat Enterprise Linux 7, usemariadbas the service name and do not usescl enable mysql55 --when creating the dump. - Import the dumped database into the rh-mysql56 Software Collection:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Example 5.4. In-place Upgrade from MySQL 5.5
If you are upgrading from the mysql55 Software Collection, perform the upgrade as shown in the following example:
For upgrading from the mariadb55 Software Collection, use the
/opt/rh/mariadb55/root/var/lib/mysql/ as a source when copying the data.
For upgrading from MariaDB 5.5 from base Red Hat Enterprise Linux 7, use the
/var/lib/mysql/ as a source when copying the data.
For more details about migration to MySQL 5.6, refer to the MySQL documentation.
5.4. Migrating to PostgreSQL 9.4 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Red Hat Software Collections 2.0 is distributed with PostgreSQL 9.4, which can be safely installed on the same machine in parallel with PostgreSQL 8.4 from Red Hat Enterprise Linux 6 or PostgreSQL 9.2 from Red Hat Enterprise Linux 7 or Red Hat Software Collections 1. 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.
5.4.1. Notable Differences Between PostgreSQL 9.2 and PostgreSQL 9.4 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The most notable changes between PostgreSQL 9.2 and PostgreSQL 9.4 are the following:
- PostgreSQL 9.4 no longer includes native support for Kerberos authentication (for example, using the
--with-krb5option). As consequence, thekrb_srvnameoption is not available anymore. The supported way to use Kerberos authentication is with Generic Security Services API (GSSAPI). - Since PostgreSQL 9.4, the
replication_timeoutconfiguration option has been split into thewal_receiver_timeoutandwal_sender_timeoutoptions. - The
scl register rh-postgresql94command is unsupported and the rh-postgresql94 Software Collection is not supported to run over NFS.
The following table provides an overview of different paths in a Red Hat Enterprise Linux system version of PostgreSQL (postgresql) and in the postgresql92 and rh-postgresql94 Software Collections. Note that the paths of PostgreSQL 8.4 distributed with Red Hat Enterprise Linux 6 and the system version of PostgreSQL 9.2 shipped with Red Hat Enterprise Linux 7 are the same.
| Content | postgresql | postgresql92 | rh-postgresql94 |
|---|---|---|---|
| Executables | /usr/bin/ | /opt/rh/postgresql92/root/usr/bin/ | /opt/rh/rh-postgresql94/root/usr/bin/ |
| Libraries | /usr/lib64/ | /opt/rh/postgresql92/root/usr/lib64/ | /opt/rh/rh-postgresql94/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/ |
| 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/ |
| 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/ |
| Source | 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/ |
| Backup area | /var/lib/pgsql/backups/ | /opt/rh/postgresql92/root/var/lib/pgsql/backups/ | /var/opt/rh/rh-postgresql94/lib/pgsql/backups/ |
| Templates | /usr/share/pgsql/ | /opt/rh/postgresql92/root/usr/share/pgsql/ | /opt/rh/rh-postgresql94/root/usr/share/pgsql/ |
| Procedural Languages | /usr/lib64/pgsql/ | /opt/rh/postgresql92/root/usr/lib64/pgsql/ | /opt/rh/rh-postgresql94/root/usr/lib64/pgsql/ |
| Development Headers | /usr/include/pgsql/ | /opt/rh/postgresql92/root/usr/include/pgsql/ | /opt/rh/rh-postgresql94/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/ |
| 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) |
For detailed changes, see the PostgreSQL 9.3 Release Notes and the PostgreSQL 9.4 Release Notes. For changes between PostgreSQL 8.4 and PostgreSQL 9.2, refer to the Red Hat Software Collections 1.2 Release Notes.
Red Hat Enterprise Linux 6 includes PostgreSQL 8.4, 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-postgresql94 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. The following procedures are applicable for both Red Hat Enterprise Linux 6 and Red Hat Enterprise Linux 7 system versions of PostgreSQL.
Important
Before migrating your data from a Red Hat Enterprise Linux system version of PostgreSQL to PostgreSQL 9.4, 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: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-postgresql94/lib/pgsql/data/does not exist: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 If you are running a fresh installation of PostgreSQL 9.4, 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-postgresql94/lib/pgsql/data{,-scl-backup}mv /var/opt/rh/rh-postgresql94/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-postgresql94 -- postgresql-setup --upgrade
scl enable rh-postgresql94 -- postgresql-setup --upgradeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can use the/opt/rh/rh-postgresql94/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-postgresql94-postgresql.loglog file to find out if any problems occurred during the upgrade. - Start the new server as
root:service rh-postgresql94-postgresql start
service rh-postgresql94-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-postgresql94 ~/analyze_new_cluster.sh'
su - postgres -c 'scl enable rh-postgresql94 ~/analyze_new_cluster.sh'Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Optionally, you can configure the PostgreSQL 9.4 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.4 server, type asroot:chkconfig rh-postgresql94-postgresql on
chkconfig rh-postgresql94-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-postgresql94/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: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-postgresql94-postgresql -- postgresql-setup --initdb
scl enable rh-postgresql94-postgresql -- postgresql-setup --initdbCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Start the new server as
root:service rh-postgresql94-postgresql start
service rh-postgresql94-postgresql startCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Import data from the previously created SQL file:
su - postgres -c 'scl enable rh-postgresql94 "psql -f ~/pgdump_file.sql postgres"'
su - postgres -c 'scl enable rh-postgresql94 "psql -f ~/pgdump_file.sql postgres"'Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Optionally, you can configure the PostgreSQL 9.4 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.4 server, type asroot:chkconfig rh-postgresql94-postgresql on
chkconfig rh-postgresql94-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-postgresql94/lib/pgsql/data/pg_hba.confconfiguration file. Otherwise only thepostgresuser will be allowed to access the database.
To migrate your data from the postgresql92 Software Collection to the rh-postgresql94 Collection included in Red Hat Software Collections 2.0, 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 9.2 to PostgreSQL 9.4, make sure that you back up all your data, including the PostgreSQL database files, which are by default located in the
/opt/rh/postgresql92/var/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:service postgresql92-postgresql stop
service postgresql92-postgresql stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow To verify that the server is not running, type:service postgresql92-postgresql status
service postgresql92-postgresql statusCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Verify that the old directory
/opt/rh/postgresql92/var/lib/pgsql/data/exists:file /opt/rh/postgresql92/var/lib/pgsql/data/
file /opt/rh/postgresql92/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-postgresql94/lib/pgsql/data/does not exist: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 If you are running a fresh installation of PostgreSQL 9.4, 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-postgresql94/lib/pgsql/data{,-scl-backup}mv /var/opt/rh/rh-postgresql94/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-postgresql94 -- postgresql-setup --upgrade --upgrade-from=postgresql92-postgresql
scl enable rh-postgresql94 -- postgresql-setup --upgrade --upgrade-from=postgresql92-postgresqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can use the/opt/rh/rh-postgresql94/root/usr/bin/postgresql-setup --upgrade --upgrade-from=postgresql92-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-postgresql94-postgresql.loglog file to find out if any problems occurred during the upgrade. - Start the new server as
root:service rh-postgresql94-postgresql start
service rh-postgresql94-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-postgresql94 ~/analyze_new_cluster.sh'
su - postgres -c 'scl enable rh-postgresql94 ~/analyze_new_cluster.sh'Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Optionally, you can configure the PostgreSQL 9.4 server to start automatically at boot time. To disable the old PostgreSQL 9.2 server, type the following command as
root:chkconfig postgresql92-postgreqsql off
chkconfig postgresql92-postgreqsql offCopy to Clipboard Copied! Toggle word wrap Toggle overflow To enable the PostgreSQL 9.4 server, type asroot:chkconfig rh-postgresql94-postgresql on
chkconfig rh-postgresql94-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-postgresql94/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:service postgresql92-postgresql start
service postgresql92-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 postgresql92 "pg_dumpall" > ~/pgdump_file.sql'
su - postgres -c 'scl enable postgresql92 "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 postgresql92-postgresql stop
service postgresql92-postgresql stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Initialize the data directory for the new server as
root:scl enable rh-postgresql94-postgresql -- postgresql-setup --initdb
scl enable rh-postgresql94-postgresql -- postgresql-setup --initdbCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Start the new server as
root:service rh-postgresql94-postgresql start
service rh-postgresql94-postgresql startCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Import data from the previously created SQL file:
su - postgres -c 'scl enable rh-postgresql94 "psql -f ~/pgdump_file.sql postgres"'
su - postgres -c 'scl enable rh-postgresql94 "psql -f ~/pgdump_file.sql postgres"'Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Optionally, you can configure the PostgreSQL 9.4 server to start automatically at boot time. To disable the old PostgreSQL 9.2 server, type the following command as
root:chkconfig postgresql92-postgresql off
chkconfig postgresql92-postgresql offCopy to Clipboard Copied! Toggle word wrap Toggle overflow To enable the PostgreSQL 9.4 server, type asroot:chkconfig rh-postgresql94-postgresql on
chkconfig rh-postgresql94-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-postgresql94/lib/pgsql/data/pg_hba.confconfiguration file. Otherwise only thepostgresuser will be allowed to access the database.
5.5. Migrating to nginx 1.6 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The nginx16 Software Collection uses a new prefix in accordance with the name of the collection and a different path to the root directory, which is now located in
/opt/rh/nginx16/root/. The error log is now stored in /var/log/nginx16/error.log by default, and the initscript is called nginx16-nginx.
Configuration files in nginx 1.6 have the same format as in the previous version and they are compatible between version 1.4 and 1.6.
Important
Before upgrading from nginx 1.4 to nginx 1.6, back up all your data, including web pages and configuration files located in the
/opt/rh/nginx14/root/ tree.
If you have made any specific changes, such as changing configuration files or setting up web applications, in the
/opt/rh/nginx14/root/ tree, replicate those changes in the new /opt/rh/nginx16/root/ directory, too.
For the official nginx documentation, refer to http://nginx.org/en/docs/.