Migrating core database connections
Creating the required core databases1 and exposing them to Martini via database connections are some of the tasks Martini automatically executes when it's first started for fast and easy set up. However, these databases run on HSQL (embedded mode) and are not ideal for production environments in Martini because file operations2 can be resource-intensive and embedded HSQL databases are limited to serving one client at a time. Thus, it is recommend to migrate to databases that are more reliable.
Depending on the Hibernate configuration, Martini may or may not automatically create the core databases'
tables for you. Although, by default, it should. Check the value of the
property and read up on how the value of this property affects your database schemas
Performing actual database migration will not be covered in this page as the process will most likely vary depending on the database(s) you are migrating to. Instead, we will enumerate the steps you need to do on Martini's side.
- Stop the database connection of the database you are migrating.
- Take note of the new database's connection details and update the affected database connection's fields accordingly.
- Ensure that Martini can connect to your database by testing your updated database connection. Martini will not start if it cannot communicate with all of the core databases.
- Save the changes.
- Lastly, restart Martini.
Just updates the database connection; doesn't migrate data
Following the steps above will update your database's connection details but it doesn't necessarily migrate the data in your old database to the new one.