Upgrading Via Docker¶
Running a Liferay Docker image with auto-upgrade enabled uses the Database Upgrade Tool to upgrade your database transparently on Liferay startup. After the upgrade completes, you can continue using Liferay via that Docker container or point a new Liferay on-premises installation to the upgraded database.
Liferay DXP (Subscription)
Upgrades to enterprise subscriber installations and critical installations should be done using the Database Upgrade Tool. See Using the Database Upgrade Tool for more information.
Always back up your database and existing installation before upgrading. Testing the upgrade process on backup copies is advised.
Upgrading with the Latest Docker Image¶
Here are the steps for upgrading with a Docker image:
Create an arbitrary folder to use with the new Liferay Docker image and create subfolders called
deploy. For example,
mkdir -p new-version/files
mkdir -p new-version/deploy
files: The Docker container copies files from this folder to the container’s Liferay Home folder.
deploy: The Docker container copies artifacts from this folder to the container’s auto-deploy folder.
If you want to upgrade your Marketplace app data along with the Liferay database upgrade, download the latest version of each app targeted for the new Liferay version and copy it to your
new-version/deployfolder. Otherwise, you can install the apps after the database upgrade and upgrade their data as described in the Post-Upgrade Considerations.
Copy and merge the Liferay Home files and application server files from your backup to their corresponding locations in the
filesfolder (your new
[Liferay Home]). For example, copy your activation key to
new-version/files/license/. The files may include but are not limited to these:
/license/*: Activation keys. (Subscription)
/log/*: Log files.
/osgi/configs/*.config: OSGi configuration files.
portal-*.properties: Portal properties files, such as
startup.sh, and more: Application server configuration scripts.
web.xml: Portal web application descriptor.
If you’re upgrading to 7.2, disable search indexing using a configuration file in your
[Liferay Home]/files/osgi/config/folder. For example,
echo "indexReadOnly=\"true\"" >> new-version/files/osgi/config/com.liferay.portal.search.configuration.IndexStatusManagerConfiguration.config
If you’re using Advanced File System Store or Simple File System Store with a modified storage location, export your file store settings to a
.configfile and copy it to your
If you’re using Advanced File System Store, you must configure it with a
.configfile in the new installation before upgrading the database.
Here’s an example
com.liferay.portal.store.file.system.configuration.AdvancedFileSystemStoreConfiguration.configfile with the required
Make sure you’re using the JDBC database driver your database vendor recommends. If you’re using MySQL, for example, set
new-version/files/portal-ext.propertiesand replace the MySQL JDBC driver JAR your app server uses. See Database Drivers for more details.
Run the Docker image mounted to your new version folder using the following command. Substitute the image name, tag, and environment values as needed.
docker run -it -m 8g -p 8080:8080 \ -v $(pwd)/new-version:/mnt/liferay \ -e LIFERAY_UPGRADE_PERIOD_DATABASE_PERIOD_AUTO_PERIOD_RUN=true \ liferay/[place image name here]:[place tag here]
-v new-version:/mnt/liferayarguments bind mount the host’s
new-versionfolder to the container’s
/mnt/liferayfolder. Please see Providing Files to the Container for more information on the mapping files to the container’s Liferay Home.
-e LIFERAY_UPGRADE_PERIOD_DATABASE_PERIOD_AUTO_PERIOD_RUN=truetriggers the database upgrade.
In the console or log, confirm successful database upgrade and server startup. Upgrade messages report starting and completing each upgrade process. A message like this one indicates server startup completion:
org.apache.catalina.startup.Catalina.start Server startup in [x] milliseconds
If there are any upgrade failures or errors, they’re printed to the console and log. You can use Gogo Shell commands to troubleshoot any issues and finish the upgrade.
After you have resolved any failures or errors, examine the Post Upgrade Considerations.
Update the Portal properties in your new installation.
Validate your upgraded database.
Your database upgrade is now complete!
If you want to continue using the new Liferay version via Docker, remove the
-e LIFERAY_UPGRADE_PERIOD_DATABASE_PERIOD_AUTO_PERIOD_RUN=true environment setting from the
docker run ... command you used to create the new container.
Using Liferay Docker Images demonstrates creating, stopping, and restarting Docker containers.
If the upgraded database is all you need, then enjoy using your new Liferay instance! If there’s more to completing your upgrade, these articles can help you finish:
Upgrade Basics describes all of the upgrade topics. Maybe there’s a topic you still need to address.
Database Upgrade Options describes all the ways of upgrading the database in the context of the various DXP/Portal installation types.
Using the Database Upgrade Tool demonstrates upgrading the database while the Liferay server is offline. If the upgrade took too long, consider tuning the database, pruning unneeded data, and using Database Upgrade Tool.
Upgrading Custom Development demonstrates adapting custom plugin code to a new Liferay version.
Maintaining Clustered Installations describes how to upgrade in a clustered environment.