The migration appplication transforms XML data from the jDV into a relational DB structure. This includes lookup tables (courts, norm abbreviations, keywords and many more) and documentation units. The caselaw application uses the database that is filled by the migration application.
This instruction will allow engineers to setup their local environment with the lookup tables, that are necessary to run the caselaw application, and some test documentation units if desired.
-
Clone ris-data-migration repository
git clone [email protected]:digitalservicebund/ris-data-migration.git
-
Follow the steps here to get access to OTC buckets via command line. You can use the
AWS_
environment variables that you use forneuris-infra
: https://platform-docs.prod.ds4g.net/user-docs/how-to-guides/access-obs-via-aws-sdk/ Check if you can access the right bucket withaws s3 ls --profile otc --endpoint-url https://obs.eu-de.otc.t-systems.com s3://neuris-migration-juris-data # output should look like this: # PRE daily/ # PRE monthly/
-
Make sure Docker is running
Checkout the tag that is used in backend/build.gradle.kts , e.g.
cd ris-data-migration
git checkout --tag "0.0.3"
From here you can run the import by:
chmod +x run_migration_locally.sh
./run_migration_locally.sh
To repeat files downloading, remove the import folder in the migration folder, and rerun.
-
In
ris-backend-service
start the databasecd ris-backend-service docker compose up postgres14 # or use your favourite startup command, e.g. ./run.sh dev --no-backend
-
All data that is migrated by the migration application resides in the
incremental_migration
DB schema. Make sure it exists in your local database -
Create a directory where you will store the xml files to import into the database in
ris-data-migration
cd ris-data-migration mkdir juris-xml-data
-
Download the lookup tables in
ris-data-migration
aws s3 cp --profile otc --endpoint-url https://obs.eu-de.otc.t-systems.com --recursive s3://neuris-migration-juris-data/monthly/2024/10/Tabellen ./juris-xml-data/Tabellen
-
Download example BGH DocumentationUnits in
ris-data-migration
aws s3 cp --profile otc --endpoint-url https://obs.eu-de.otc.t-systems.com --recursive s3://neuris-migration-juris-data/monthly/2024/05/BGH-juris/RSP/2022/ ./juris-xml-data/BGH-juris/RSP/2022/
-
Setup your local .env file with this command as described in Set up local env
-
Change the
.env
file inris-migration-data
with the following variables:RIS_MIGRATION_TABLES_LOCATION=juris-xml-data RIS_MIGRATION_INCLUDE_NORM_ABBREVIATIONS=true RIS_MIGRATION_CLI_MODE=true # database config RIS_MIGRATION_DB_HOST=localhost RIS_MIGRATION_DB_PORT=5432 RIS_MIGRATION_DB_NAME=neuris RIS_MIGRATION_DB_USER=migration RIS_MIGRATION_DB_PASSWORD=migration RIS_MIGRATION_DB_SCHEMA=incremental_migration
-
For console logging
export SPRING_PROFILES_ACTIVE=dev
-
Build the ris-data-migration application into a jar
./gradlew :cli:bootJar
-
Import the static lookup tables into your new schema (see Confluence "Wertetabellen" to find out what is static and dynamic)
java -jar cli/build/libs/ris-data-migration-cli.jar refdata seed
-
Import the dynamic lookup tables
java -jar cli/build/libs/ris-data-migration-cli.jar juris-table seed
-
Import the BGH DocumentationUnits
java -jar cli/build/libs/ris-data-migration-cli.jar juris-r migrate -p juris-xml-data/
-
Checkout
ris-data-migration
at the currently used tag (see "Checkout Migration at Current Tag" above) -
Download the new lookup tables and document units (see steps 4 and 5 above)
-
If you need to fill new categories in all documentation units, truncate the
incremental_migration
schema -
To update/reimport new data, repeat steps 9 - 12 above
Delete the folder in pointed in DATA_MIGRATION_IMPORT_PATH
, update the month/day in the s3 commands and rerun the script. It will download the necessary files again.
./run_migration_locally.sh