Since Liferay DXP 7.0, Liferay removed its own physical partitioning implementation (also known as sharding) in favor of the capabilities provided natively by database vendors. Upgrading a sharded installation to Liferay DXP 7.1 requires migrating it to as many non-sharded Liferay DXP installations (servers) as you have shards. These steps guide you through configuring the new Liferay DXP servers to use your formerly sharded data and upgrading the data to Liferay DXP 7.1.
Here are the upgrade steps:
-
If you’re on Liferay Portal 6.1 or lower, upgrade to Liferay Portal 6.2.
-
Run the upgrade process for the default shard. As part of the configuration, copy all of the shard JDBC connection properties from your
portal-ext.properties
to yourportal-upgrade-database.properties
. For example, JDBC connections for a default shard and two non-default shards might look like this:jdbc.default.driverClassName=com.mysql.jdbc.Driver jdbc.default.url=jdbc:mysql://localhost/lportal?characterEncoding=UTF-8&dontTrackOpenResources=true&holdResultsOpenOverStatementClose=true&useFastDateParsing=false&useUnicode=true jdbc.default.username= jdbc.default.password= jdbc.one.driverClassName=com.mysql.jdbc.Driver jdbc.one.url=jdbc:mysql://localhost/lportal_one?characterEncoding=UTF-8&dontTrackOpenResources=true&holdResultsOpenOverStatementClose=true&useFastDateParsing=false&useUnicode=true jdbc.one.username= jdbc.one.password= jdbc.two.driverClassName=com.mysql.jdbc.Driver jdbc.two.url=jdbc:mysql://localhost/lportal_two?characterEncoding=UTF-8&dontTrackOpenResources=true&holdResultsOpenOverStatementClose=true&useFastDateParsing=false&useUnicode=true jdbc.two.username= jdbc.two.password=
-
Prepare a Liferay DXP 7.1 server for each non-default shard.
-
Run the upgrade process for each non-default shard. The JDBC default connection properties in each server’s
portal-upgrade-database.properties
must specify the associated shard. Here’s how:-
Add the original JDBC properties for the respective non-default shard database. For example, shard
one
’s original properties might start withjdbc.one
:jdbc.one.driverClassName=com.mysql.jdbc.Driver jdbc.one.url=jdbc:mysql://localhost/lportal_one?characterEncoding=UTF-8&dontTrackOpenResources=true&holdResultsOpenOverStatementClose=true&useFastDateParsing=false&useUnicode=true jdbc.one.username= jdbc.one.password=
-
Rename the properties to start with
jdbc.default
. For example,jdbc.default.driverClassName=com.mysql.jdbc.Driver jdbc.default.url=jdbc:mysql://localhost/lportal_one?characterEncoding=UTF-8&dontTrackOpenResources=true&holdResultsOpenOverStatementClose=true&useFastDateParsing=false&useUnicode=true jdbc.default.username= jdbc.default.password=
-
-
In each server’s
portal-ext.properties
, use the JDBC default properties you specified in theportal-upgrade-database.properties
(see the previous step). -
Remove the non-default shard JDBC properties from the default shard server’s
portal-ext.properties
file, leaving only the default shard databasejdbc.default
properties. For example,Old JDBC properties:
jdbc.default.driverClassName=com.mysql.jdbc.Driver jdbc.default.url=jdbc:mysql://localhost/lportal?characterEncoding=UTF-8&dontTrackOpenResources=true&holdResultsOpenOverStatementClose=true&useFastDateParsing=false&useUnicode=true jdbc.default.username= jdbc.default.password= jdbc.one.driverClassName=com.mysql.jdbc.Driver jdbc.one.url=jdbc:mysql://localhost/lportal_one?characterEncoding=UTF-8&dontTrackOpenResources=true&holdResultsOpenOverStatementClose=true&useFastDateParsing=false&useUnicode=true jdbc.one.username= jdbc.one.password= jdbc.two.driverClassName=com.mysql.jdbc.Driver jdbc.two.url=jdbc:mysql://localhost/lportal_two?characterEncoding=UTF-8&dontTrackOpenResources=true&holdResultsOpenOverStatementClose=true&useFastDateParsing=false&useUnicode=true jdbc.two.username= jdbc.two.password=
New JDBC properties:
jdbc.default.driverClassName=com.mysql.jdbc.Driver jdbc.default.url=jdbc:mysql://localhost/lportal?characterEncoding=UTF-8&dontTrackOpenResources=true&holdResultsOpenOverStatementClose=true&useFastDateParsing=false&useUnicode=true jdbc.default.username= jdbc.default.password=
Congratulations! You have migrated off of a sharded environment to virtual instances on separate Liferay DXP servers. You have also upgraded to Liferay DXP 7.1. Your virtual instances are ready for action.