Metadata Migration
To ensure a clean migration, shut down the non-coordinator services to ensure that metadata state will not change as you do the migration.
When migrating from Derby, the coordinator processes will still need to be up initially, as they host the Derby database.
Druid provides an Export Metadata Tool for exporting metadata from Derby into CSV files which can then be imported into your new metadata store.
Run the tool on your existing cluster, and save the CSV files it generates. After a successful export, you can shut down the coordinator.
Before importing the existing cluster metadata, you will need to set up the new metadata store.
The and PostgreSQL extension docs have instructions for initial database setup.
Druid provides a metadata-init
tool for creating Druid’s metadata tables. After initializing the Druid database, you can run the commands shown below from the root of the Druid package to initialize the tables.
In the example commands below:
lib
is the Druid lib directorybase
corresponds to the value of in the configuration,druid
by default.- The
--connectURI
parameter corresponds to the value ofdruid.metadata.storage.connector.connectURI
. - The
--user
parameter corresponds to the value of . - The
--password
parameter corresponds to the value ofdruid.metadata.storage.connector.password
.
MySQL
PostgreSQL
cd ${DRUID_ROOT}
After initializing the tables, please refer to the import commands for your target database.