LucidDbMoveCatalog

From LucidDB Wiki
Jump to: navigation, search

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.

  1. Export the complete catalog as an XMI file to a backup location.
    1. Goto LucidDb directory.
      $ cd dev/luciddb
    2. Start LucidDb.
      $ ./sqllineEngine
    3. Export the existing catalog to a new archive_path location.
      0: jdbc:luciddb:> CALL sys_boot.mgmt.export_catalog_xmi('/archive_path/LucidDbCatalogDump.xmi');
    4. Shutdown LucidDb.
      0: jdbc:luciddb:> !quit
  2. Copy *.dat from LucidDB catalog location to your previously created <archive_path> location.
    $ mkdir /archive_path
    $ cp dev/luciddb/catalog/*.dat /archive_path/.
  3. Switch repository storage.
    1. Go to farrago directory.
      $ cd dev/farrago
    2. Switch to new MySQL catalog format.
      $ ant switchToMysqlHibernateReposStorage
      $ ant createCatalog
  4. Create a new LucidDb catalog.
    1. Go to LucidDb directory.
      $ cd dev/luciddb
    2. Temporary revert to clean LucidDb catalog.
      $ ant createCatalog
  5. Prepare the database to receive the old catalog on next restart.
    1. First, start LucidDb.
      $ ./sqllineEngine
    2. Next, execute the ALTER SYSTEM command.
      0: jdbc:luciddb:> ALTER SYSTEM REPLACE CATALOG
  6. Copy *.dat and LucidDbCatalogDump.xmi from your archive_path location back to LucidDB catalog location.
    $ cp /archive_path/* dev/luciddb/catalog/.
  7. 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.
Personal tools
Product Documentation