LucidDbMoveCatalog
under construction
Contents |
Overview
This page provides the steps needed to move LucidDb catalog from one db-type to another db-type. A use case is described to show how a LucidDb administrator can move the existing catalog from hsqldb to MySQL.
References
If you are not familiar with LucidDb catalog, read the following pages:
Existing Catalog
There are four types of repository storage backends: Hibernate with hsqldb, Hibernate with MySQL, Netbeans with hsqldb, and Netbeans with psql. Unless you run initBuild.sh from dev/luciddb with parameter --with-repos-type=mysql/hibernate, your catalog will not have Hibernate with MySQL repos storage. The default repos-type option of LucidDb's initBuild.sh is Hibernate with hsqldb repos storge. File ReposStorage.properties under dev/luciddb/catalog has the information about the implementation type of the existing catalog. This property file does not exist if catalog never being created previously.
Moving the Existing Catalog
In this scenario, existing LucidDb catalog is moved from hsqldb to mysql format.
-
Export the complete catalog as an XMI file to a backup location.
-
Goto LucidDb directory.
$ cd dev/luciddb
-
Start LucidDb.
$ ./sqllineEngine
-
Export the existing catalog to a new archive_path location.
0: jdbc:luciddb:> CALL sys_boot.mgmt.export_catalog_xmi('/archive_path/LucidDbCatalogDump.xmi'); -
Shutdown LucidDb.
0: jdbc:luciddb:> !quit
-
Goto LucidDb directory.
-
Copy *.dat from LucidDB catalog location to your previously created <archive_path> location.
$ mkdir /archive_path
$ cp dev/luciddb/catalog/*.dat /archive_path/.
-
Switch repository storage.
-
Go to farrago directory.
$ cd dev/farrago
-
Switch to new MySQL catalog format.
$ ant switchToMysqlHibernateReposStorage
$ ant createCatalog
-
Go to farrago directory.
-
Create a new LucidDb catalog.
-
Go to LucidDb directory.
$ cd dev/luciddb
-
Temporary revert to clean LucidDb catalog.
$ ant createCatalog
-
Go to LucidDb directory.
-
Prepare the database to receive the old catalog on next restart.
-
First, start LucidDb.
$ ./sqllineEngine
-
Next, execute the ALTER SYSTEM command.
0: jdbc:luciddb:> ALTER SYSTEM REPLACE CATALOG
-
First, start LucidDb.
-
Copy *.dat and LucidDbCatalogDump.xmi from your archive_path location back to LucidDB catalog location.
$ cp /archive_path/* dev/luciddb/catalog/.
-
Finally, restart LucidDb.
0: jdbc:luciddb:> !quit
$ ./sqllineEngine
Verification
- Open ReposStorage.properties under dev/luciddb/catalog. Verify that your desired repository storage backend is defined properly.
- Verify that LucidDb instance can be run successfully using the new catalog format.