Fórumok

Clean up database after deinstallation of marketplace app

Thomas Lucas, módosítva 9 év-val korábban

Clean up database after deinstallation of marketplace app

New Member Bejegyzések: 7 Csatlakozás dátuma: 2012.11.11. Legújabb bejegyzések
What is the best practise to remove database tables after removing a marketplace app.
For example I have tested enforms. After removing (Deinstallation inside app Manager) all app specific data tables are still there.
Thanks
Thomas
thumbnail
Andew Jardine, módosítva 9 év-val korábban

RE: Clean up database after deinstallation of marketplace app

Liferay Legend Bejegyzések: 2416 Csatlakozás dátuma: 2010.12.22. Legújabb bejegyzések
Hi Thomas,

I've only ever done this manually (I'm not aware of any other way to do it). Having said that, I almost never do this in a production level environment -- mostly due to data retention policies etc.
Thomas Lucas, módosítva 9 év-val korábban

RE: Clean up database after deinstallation of marketplace app

New Member Bejegyzések: 7 Csatlakozás dátuma: 2012.11.11. Legújabb bejegyzések
Hi Andew,
that was my first idea too. And surely I am talking about developement evirement.
I have not a lot experience with liferay- only in different CMS Frameworks (like typo3).
There database is cleaned, when removing an addon :-)
thumbnail
Andew Jardine, módosítva 9 év-val korábban

RE: Clean up database after deinstallation of marketplace app

Liferay Legend Bejegyzések: 2416 Csatlakozás dátuma: 2010.12.22. Legújabb bejegyzések
Hi Thomas,

I can see where there could be some advantages in having that, though I think, personally, it's safer to make that step a manual one. I know myself I have on occasion accidentally deleted a plugin folder from the server. The nice thing about the database content remaining is that all you need to do is redeploy the plugin and keep going like nothing happened. Nuking all the data would be disastrous in a scenario like the one I just described.

Having said that, I could see the value in a property setting that would allow you to set the environment in development mode in which case the Undeployment of a plugin (with a service builder definition) could perform the celanup as well.
thumbnail
David H Nebinger, módosítva 9 év-val korábban

RE: Clean up database after deinstallation of marketplace app

Liferay Legend Bejegyzések: 14917 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Thomas Lucas:
After removing (Deinstallation inside app Manager) all app specific data tables are still there.


So liferay supports initial startup activities to create tables and populate data, but it does not support any way to clean up stuff when uninstalled. So this is more a Liferay issue in general than a marketplace issue, I believe.
thumbnail
Olaf Kock, módosítva 9 év-val korábban

RE: Clean up database after deinstallation of marketplace app

Liferay Legend Bejegyzések: 6403 Csatlakozás dátuma: 2008.09.23. Legújabb bejegyzések
Note that due to the nature of a Java appserver, even an update to an app includes an uninstall (when the previous version is undeployed, just before being upgraded). Thus the behaviour that you seem to expect couldn't work - at least not automatically.

AFAIK this would have to be done by each plugin, as it knows what kind of data it introduces. There's no Liferay mechanics and if it's not obvious in the plugin you used, it's probably not there. I'm not aware of any plugin that cleans up after itself. Sadly, manually deleting the tables seems to be your ownly option if you want to get rid of the tables. But I haven't said that - I never recommend manual intervention on the database level. With that in mind, your only option is to keep them staying around. Maybe you'll come back to this plugin later and can make use of the existing database.

Olaf