Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Database update on new service builder version
Hi everyone,
We are making a service builder for all of our REST web services. We wanted to apply continuous integration. It works well except for the deploy : if there is an update or add of an entity in the service.xml file, there is an error of "Already existing relationship" on our tables, which does not happen in development. This error completely stops the deployment process.
Is there a way to update database automatically during deployment without crushing existing tables and data ?
We are making a service builder for all of our REST web services. We wanted to apply continuous integration. It works well except for the deploy : if there is an update or add of an entity in the service.xml file, there is an error of "Already existing relationship" on our tables, which does not happen in development. This error completely stops the deployment process.
Is there a way to update database automatically during deployment without crushing existing tables and data ?
Nils Wilmet:
Check LPS-67688 for a discussion of the background, and instructions on how to write the appropriate upgrade process (or use the developer-workaround) - find some updated working links to documentation in the last comment to the issue, and look for your version's documentation.
Is there a way to update database automatically during deployment without crushing existing tables and data ?
Hi Olaf,
Thanks for the reply. I did read the "Creating Data Upgrade Processes for Modules" tutorial.And from what I understood, we need to make some sort of SQL statements at each schema update ? It's too bad because we lose the automatic process of deploying a new version, and for the CI it would force the developer to write down each new modification before integration...If there is any other way to do that, i'll take it
Thanks a lot !
Thanks for the reply. I did read the "Creating Data Upgrade Processes for Modules" tutorial.And from what I understood, we need to make some sort of SQL statements at each schema update ? It's too bad because we lose the automatic process of deploying a new version, and for the CI it would force the developer to write down each new modification before integration...If there is any other way to do that, i'll take it

Thanks a lot !
Hi Nils,There are two ways to apply new changes to your current schema:
- Following the official procedure that Olaf has explained. We follow that approach in Liferay and it's not a big deal and we also have continuous integration, I don't know why a new process that executes the changes can be a problem for that.
- Make the SQL changes by yourself in some other way if you don't care about tracking every schema change. We support 6 different database vendors so any schema change needs to be tracked with a specific schema version but maybe in your case, it's easier and you don't need it.Apart from this, please take into account the following link if you upgraded from WAR to Osgi module a service builder plugin:https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/upgrade-processes-for-former-service-builder-plugins
- Following the official procedure that Olaf has explained. We follow that approach in Liferay and it's not a big deal and we also have continuous integration, I don't know why a new process that executes the changes can be a problem for that.
- Make the SQL changes by yourself in some other way if you don't care about tracking every schema change. We support 6 different database vendors so any schema change needs to be tracked with a specific schema version but maybe in your case, it's easier and you don't need it.Apart from this, please take into account the following link if you upgraded from WAR to Osgi module a service builder plugin:https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/upgrade-processes-for-former-service-builder-plugins
Hi Alberto,
Thanks for your help. We managed to build some SQL script to backup data before deleting tables, recreate them and insert data again.
Thanks again for all your useful informations !
Thanks for your help. We managed to build some SQL script to backup data before deleting tables, recreate them and insert data again.
Thanks again for all your useful informations !
Glad to hear that!
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™