Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Data Migration between Metadata Repository Version Upgrade

Bo Ferri edited this page Sep 1, 2015 · 2 revisions

Use Case: We would like to migrate existing data in the Metadata Repository, e.g., Resources, Configurations, Projects, into a newer state of the Metadata Repository, e.g., after the inbuilt Schemata have been upgraded.

Metadata Repository Migration Guide

Following steps could be done to achieve a new, consistent state in the Metadata Repository:

  1. Dump all Projects, Data Models, Resources and Configurations as JSON via their respective APIs
  2. Upgrade the system (incl. a new initial state of the Metadata Repository ("init SQL" script etc.))
  3. Run a script that does the following
    1. (Re-)Create all Resources and Configurations from their JSON files via their respective APIs
    2. (Re-)Create all Data Models from their JSON files via its respective API
      1. Replace their Schemata with a current state of the Schemata (from the Metadata Repository), if they are an inbuilt Schemata
      2. (Re-)Create the Schemata (incl. Attribute Paths etc.) if they are no inbuilt Schemata
      3. (Re-)Create all Data Models with their updated Schemata
    3. (Re-)Create all Projects from their JSON files via its respective API
      1. Replace their Data Models (Input Data Model and Output Data Model) with a current state of the Data Models (from the Metadata Repository)
      2. Replace the Attribute Paths of the Mappings with a current state of the Attribute Path (from the Metadata Repository)
      3. (Re-)Create all Projects with their updated parts

Metadata Repository Migrator

The Metadata Repository Migrator does exactly the steps described above. To apply the Metadata Repository migration script you need to do the following:

  1. Load the Metadata Repository state you want to migrate into your Metadata Repository
  2. Checkout the latest state of the D:SWARM backend
  3. Build the backend, e.g., via mvn clean package -DskipTests -Pdswarm-conf
  4. Switch to persistence module (cd persistence)
  5. Execute Metadata Repository migration script via mvn exec:exec -Pdswarm-conf

The migrated state should then be located in the Metadata Repository.

Clone this wiki locally