This blog contains instructions on how to clean, rebuild, backup, restore and update the database.
The ant target for this operation is “clean-database”. This operation only cleans the current database. It does not clean a backup of a previous version of the database that may have been created.
The ant target for this operation is “schema-export”. All data that exists in the database is lost when the database is rebuilt.
The ant target for this operation is “backup-database”. This will create a backup copy of the database. Only one backup copy is maintained at any given time. i.e. each time a backup is created, the new backup copy wipes out an earlier backup if one existed. It is a good practice to make frequent backups.
The ant target for this operation is “restore-database”. The database is restored to the last backup version, if one exists.
The model on which JTS is built closely resembles JSIDL. As the JAUS standard and JTS evolve, it is highly likely that both JSIDL and the model behind JTS may change. Each time this happens, existing databases and its data may get out of synch with the new model and schema and may need to be updated.
The easy way to perform an update is to use the “schema-update” ant target. This can be used if the change is a typical backwards compatible change that involves the addition of new attributes to types.
For more complex changes, follow the procedure below (courtesy the jMatter user guide).
1. Dump your data out of the database
2. ant schema-export (wipes out the data)
3. restore the data
The restoration of data usually needs to be broken down into at least these steps:
1. drop constraints on your schema
2. restore the data
3. add the constraints back in