Blogs
Cleaning your DB before upgrading can save time during the upgrade.
As Liferay suggests in https://portal.liferay.dev/docs/7-0/deploy/-/knowledge_base/d/pre-upgrade-speed-up-the-process, you can save significant time in your upgrade process if you take the time to clean out the cruft in your database.
Over time, your Liferay database will be loaded with web contents, documents, images, etc. Users have come and gone, but their data remains. Perhaps the default user public and private sites were never deactivated and have been left on all of this time. And you've created instances (companies) and/or sites to test things out that you don't really need anymore.
During a Liferay upgrade, all of these records can be touched by the upgrade process in one way or another. Having unnecessary data in the database can increase the time it takes to complete the upgrade. As a best practice, Liferay recommends deleting this old data before starting the upgrade process.
Although Liferay tells you to do this, there hasn't been a tool available to actually help complete this task.
Until now...
Introducing the DB Pruner
The DB Pruner is a tool that can help clean the cruft out of your database and get you ready for the upgrade.
It is available for Liferay 6.2 (CE/EE), Liferay 7.0 (CE/DXP) and Liferay 7.1 (CE/DXP).
The tool provides a wizard-like way to process cruft in the database.
The following cleanup aspects are supported:
- Unused instances (companies)
- Unused sites
- Old document versions
- Old web content versions
- Orphaned documents
- Idle users
- Recycle bins
- User public/private layouts
- Audit records
By pruning these records before you complete an upgrade, your upgrade time can be significantly shortened.
Even from an ongoing maintenance perspective, purging these unnecessary records can shrink your database size and shorten the time it takes to backup your database.
Give DB Pruner a try today!

