Restoring Database on Staging/Production environment

My application is based on MySql database, and I am deploying the WAR files on a Jetty environment.
After performing the first intial deployment successfully and updated the entry in jetty-xml file to point to the production database, I have restored the database from my development server on the production server, and purged my application tables from dummy data used during development.
However, the server failed to start (cannot find SYS_CONFIG table), although the table exists on the production database and is accessible.
I tried many times to copy the tables manually and to explore the data in the SYS and SEC tables to see if any suspicious records are to be added or deleted. All resulted in the same error.
To solve the issue, I had to remove all objects (app and Cuba tables, functions, triggers, etc…) from the production server, then connected Cuba Studio installed on my development machine to the production database and used the “Update Database” wizard.
The production environment is working perfectly now.
My question is:

  1. Is this the proper way to restore a production database based on development environment? Ideally, cuba studio is not supposed to be installed on a production box or to connect to a production database right?
  2. What is the best way to perform incremental deployments when it comes to database changes? Shall I maintain the update/alter/etc… scripts and run them manually on the production server? Can this process be automated somehow?

Many Thanks.

Shady Hanna


Have you read this section in the docs? And of course neither Studio nor project source code are supposed to be installed on a production server.

Let us know if you have any further questions.

Hi Konstantin,

I have gone through above section. Basically, when I update an entity (for example adding an attribute to an entity), I can see the automatically generated update scripts, and I am maintaining them for the next live deployment.

Are there cases of changes where I have to manually capture the scripts? For example, today I upgraded the framework to version 6.4.5 and got an alert that the database structure might have been modified.
Where are these scripts maintained?

Same question applies to when I enable to reports or the charts add-ons.

Thanks for your continuous support.