Now, ready to upgrade database Liferay 6.2 to 7.1, Liferay 7.1/DXP gives upgrade tool to upgrade everything. It’s the best, most comprehensive thanks to upgrade tool provided by Liferay. Please follow below steps to upgrade database(Steps are given for both Ubuntu/Window).
Create a new database for Liferay 7.1/DXP in MySQL server
e.g. create database Liferay_dxp_db character set utf8
Take backup and restore
Create a database dump from liferay 6.2 database and restore that dump into a new liferay 7.1/DXP database
Open database terminal(Workbench)
Take back up
mysqldump -u[username] -p[password] liferay_old_db > liferay_dump_file.sql
To create dump file : mysqldump -uroot -proot liferay_old_db > liferay_dump_file.sql
To restore dump file into new DB(Liferay 7.1/DXP) : mysql -uroot -proot liferay_dxp_db < liferay_dump_file.sql
Open CMD with administrator
cd C:\Program files\MySQL\MySQL Server 5.7\bin
run below command
To create dump file : mysqldump -uroot -proot liferay_old_db > C:\liferay_dump_file.sql
To restore dump file into new DB(Liferay 7.1/DXP) : mysql -uroot -proot liferay_dxp_db < C:\liferay_dump_file.sql
Specify database connection properties
Create a file ‘portal-setup-wizard.properties’ and specify the below DB connection properties within it:
Note: DO NOT START Liferay DXP server at this point. Otherwise, you will get an error like java.lang.RuntimeException
Copy document_library (You can find from [Liferay Home]/data/) folder from Liferay 6.2 to Liferay 7.1/DXP, copy images folders into data folder also. This data will be stored in the default store and you can also choose your location, it's up to your choice.
Disable indexer and autoUpgrade
Now, we need to disable indexing since we are going to start the database upgrade process for our new environment. Using this we can disable reindexing content and performance issues to be arised. For this, we have to follow below steps.
Need to create file in liferay 7.1/DXP :
"com.liferay.portal.search.configuration.IndexStatusManagerConfiguration.config" on this location [Liferay Home]/osgi/configs and add below content
Then create another file in the same folder :
"com.liferay.portal.upgrade.internal.configuration.ReleaseManagerConfiguration.config" and add below content
Configure the upgrade tool
Unlike previous Liferay versions, here we just need to specify database configuration properties, and database upgrade process will run upon liferay server startup, Liferay 7.x provides a dedicated tool for database upgrade 'portal-tools-db-upgrade-client' in [Liferay Home]/tools folder
Now, we need to configure below files before running the upgrade:
Tomcat configuration in Liferay
Liferay portal upgrade database properties
Liferay portal upgrade database ext.properties
We have to check a release buildNumber from DB before running the upgrade tool, it will be incremented after each deployment in Service Builder which is used for generating internal database persistence code.
Using this query you can find current buildNumber:
Now, The last and most important step is remaining which can only be taken post-upgrade and to enable indexer. For this, you have to modify the file "com.liferay.portal.search.configuration.IndexStatusManagerConfiguration.config" in the folder [Liferay Home]/osgi/configs with the following content
Good job, You’re almost at the end. Now let’s start Liferay.
For professional paid support, you may contact us at firstname.lastname@example.org .