New Marketplace Plugin: DB Pruner

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!

 

Blogs

Hi David,

 

I have one development instance and one production instance for Liferay 6.2. Do I need to buy 2 licenses for the portlet?

 

Thank you.

Alla

Sorry Alla I didn't see this message before, I believe it was while I was on vacation...

 

I think you would need the 2 licenses, although I don't really get into the details w/ how the licensing works for prod vs non prod...

and also, can the DB Pruner be used for Liferay 7.2 DXP?

Hi Alla, I kind of envisioned this as a tool to help during upgrades, and since 7.3 doesn't exist yet, I didn't think there was a call for it.

 

That said, since I rely on the target platform stuff for my projects, I can easily create a new version for 7.2. Is that something you'd be interested in?

Hi David,

 

I bought the portlet, downloaded it from the Liferay website, and tried to install through the interface.

 

Here is what I have in the log:

 

15:30:04,872 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][AutoDeployDir:204] Processing DB Pruner.lpkg 15:30:04,874 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][LiferayPackageAutoDeployListener:51] Extracting Liferay package for /data/webapps/secure/liferay/WEB-INF/deploy/DB Pruner.lpkg 15:30:04,875 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][LiferayPackageAutoDeployer:80] Extracting db-pruning-wizard-portlet-1.0.0.0.war from DB Pruner.lpkg 15:30:04,877 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][LiferayPackageAutoDeployer:80] Extracting liferay-marketplace.properties from DB Pruner.lpkg 15:30:04,879 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][LiferayPackageAutoDeployListener:57] Liferay package for /data/webapps/secure/liferay/WEB-INF/deploy/DB Pruner.lpkg extracted successfully. Deployment will start in a few seconds. 15:30:14,880 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][AutoDeployDir:204] Processing db-pruning-wizard-portlet-1.0.0.0.war 15:30:14,881 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][PortletAutoDeployListener:79] Copying portlets for /data/webapps/secure/liferay/WEB-INF/deploy/db-pruning-wizard-portlet-1.0.0.0.war 15:30:14,909 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:868] Deploying db-pruning-wizard-portlet-1.0.0.0.war 15:30:15,743 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:2401] Modifying Servlet 2.4 /var/cache/tomcat6/temp/20191210153014914/WEB-INF/web.xml 15:30:15,867 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][PortletAutoDeployListener:91] Portlets for /data/webapps/secure/liferay/WEB-INF/deploy/db-pruning-wizard-portlet-1.0.0.0.war copied successfully. Deployment will start in a few seconds.

 

 

Is there anything I am missing?   Does the Liferay installation need to have access to the Internet?

 

Thank you.

Alla

Looks like I cannot deploy the portlet:

02:11:25,936 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][AutoDeployDir:204] Processing DB Pruner.lpkg 02:11:25,937 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][LiferayPackageAutoDeployListener:51] Extracting Liferay package for /data/webapps/secure/liferay/WEB-INF/deploy/DB Pruner.lpkg 02:11:25,938 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][LiferayPackageAutoDeployer:80] Extracting db-pruning-wizard-portlet-1.0.0.0.war from DB Pruner.lpkg 02:11:25,940 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][LiferayPackageAutoDeployer:80] Extracting liferay-marketplace.properties from DB Pruner.lpkg 02:11:25,941 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][LiferayPackageAutoDeployListener:57] Liferay package for /data/webapps/secure/liferay/WEB-INF/deploy/DB Pruner.lpkg extracted successfully. Deployment will start in a few seconds. 02:11:35,942 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][AutoDeployDir:204] Processing db-pruning-wizard-portlet-1.0.0.0.war 02:11:35,943 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][PortletAutoDeployListener:79] Copying portlets for /data/webapps/secure/liferay/WEB-INF/deploy/db-pruning-wizard-portlet-1.0.0.0.war 02:11:35,956 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:868] Deploying db-pruning-wizard-portlet-1.0.0.0.war 02:11:35,960 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:971] Updating db-pruning-wizard-portlet from version 1.0.0.0 to version 1.0.0.0 02:11:35,960 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][DeployUtil:209] Undeploy /usr/share/tomcat6/webapps_secure/db-pruning-wizard-portlet 02:11:35,994 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][DeployUtil:234] Wait 0 ms to allow the plugin time to fully undeploy 02:11:36,699 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:2401] Modifying Servlet 2.4 /var/cache/tomcat6/temp/20191212021135994/WEB-INF/web.xml 02:11:36,765 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][PortletAutoDeployListener:91] Portlets for /data/webapps/secure/liferay/WEB-INF/deploy/db-pruning-wizard-portlet-1.0.0.0.war copied successfully. Deployment will start in a few seconds. 02:11:44,661 INFO  [ContainerBackgroundProcessor[StandardEngine[Catalina]]][HotDeployEvent:145] Plugin db-pruning-wizard-portlet requires marketplace-portlet 02:11:44,664 INFO  [ContainerBackgroundProcessor[StandardEngine[Catalina]]][PluginPackageUtil:1016] Reading plugin package for db-pruning-wizard-portlet 02:11:45,315 WARN  [ContainerBackgroundProcessor[StandardEngine[Catalina]]][PluginPackageUtil:1364] Unable to reindex unistalled package db-pruning-wizard-portlet: Unable to download file http://plugins.liferay.com/enterprise/liferay-plugin-repository.xml because of response code 404

 

Is there anything I can do to get it deployed?

 

I have Liferay 6.2 GA1 EE

Did you deploy the latest 6.2 version of the marketplace?

No, I did not, because when I tried updating the marketplace plugin, Liferay never started.

Hello David,

We have purchased this app but not able to get the license. We are getting portlet is temporary unavailable while trying to register our server for the license. Kindly help

Regards,

Anjali