{"id":42279529,"url":"https://github.com/ehrbase/migration-tool","last_synced_at":"2026-01-27T08:17:51.777Z","repository":{"id":232184302,"uuid":"780864329","full_name":"ehrbase/migration-tool","owner":"ehrbase","description":"Migrate EHRbase data across major versions","archived":false,"fork":false,"pushed_at":"2025-10-23T11:56:28.000Z","size":434,"stargazers_count":1,"open_issues_count":7,"forks_count":0,"subscribers_count":9,"default_branch":"develop","last_synced_at":"2025-10-23T13:24:58.365Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ehrbase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-02T09:57:04.000Z","updated_at":"2024-07-17T11:22:11.000Z","dependencies_parsed_at":"2024-05-13T15:03:45.417Z","dependency_job_id":"0af7c4f9-b132-4161-8954-4dba6f521250","html_url":"https://github.com/ehrbase/migration-tool","commit_stats":null,"previous_names":["ehrbase/migration-tool"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ehrbase/migration-tool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehrbase%2Fmigration-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehrbase%2Fmigration-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehrbase%2Fmigration-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehrbase%2Fmigration-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ehrbase","download_url":"https://codeload.github.com/ehrbase/migration-tool/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehrbase%2Fmigration-tool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28809460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T07:41:26.337Z","status":"ssl_error","status_checked_at":"2026-01-27T07:41:08.776Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-27T08:17:51.087Z","updated_at":"2026-01-27T08:17:51.767Z","avatar_url":"https://github.com/ehrbase.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EHRbase 2 Migration Tool\n\nEHRbase 2 comes with a completely overhauled data structure that cannot be automatically migrated \nby deploying the new version over an older data structure.\n\nThis migration tool can be used to migrate the data from an existing EHRbase 0.x.x database \ninto an empty database prepared for EHRbase 2.\n\n## Prerequisites\n\nIf the source database is not yet on version 0.32.0, it will be migrated to that version.\nHence, it is recommended to use a clone of that database.\n\nBefore running the migration tool, make sure that the System ID used by EHRbase is consistent.\nIn the `ehr.system` table from the source database there should be exactly one entry with `system.description = 'DEFAULT RUNNING SYSTEM'`.\n`system.settings` must match the `SERVER_NODENAME` environment variable (or spring configuration setting) provided to EHRbase.\n\nThe target database needs to be prepared according to the instructions in the [EHRbase 2.0.0 README](https://github.com/ehrbase/ehrbase/tree/v2.0.0?tab=readme-ov-file#1-setup-database).\n\n## Performing the migration\n\nThe migration can be run directly from the source code, or the provided docker image. As a naming convention an `export`\ndatasource represents an EHRbase 0.x.x database where an `import` datasource represents an EHRbase 2 database.\n\nThe properties must be adjusted according to the set-up:\n\n### Spring boot\n```\nmvn package\n\njava -jar application/target/migration-tool.jar \\\n-Dmode=DB2DB \\\n-Dspring.datasource.import.url=jdbc:postgresql://localhost:5432/ehrbase_new \\\n-Dspring.datasource.import.username=ehrbase \\\n-Dspring.datasource.import.password=ehrbase \\\n-Dspring.datasource.export.url=jdbc:postgresql://localhost:5432/ehrbase_old \\\n-Dspring.datasource.export.username=ehrbase \\\n-Dspring.datasource.export.password=ehrbase \\\n-Dimport.ehrbase-db-user=ehrbase_restricted\n```\n\n### Docker\n```\nmvn verify\n\ndocker run ehrbase/migration-tool:1.1.0 \\\n-e mode=DB2DB \\\n-e spring.datasource.import.url=jdbc:postgresql://localhost:5432/ehrbase_new \\\n-e spring.datasource.import.username=ehrbase \\\n-e spring.datasource.import.password=ehrbase \\\n-e spring.datasource.export.url=jdbc:postgresql://localhost:5432/ehrbase_old \\\n-e spring.datasource.export.username=ehrbase \\\n-e spring.datasource.export.password=ehrbase \\\n-e import.ehrbase-db-user=ehrbase_restricted\n```\n\nIn case the migration fails, the target database should be dropped and recreated.\n\nShould the migration be run against an already migrated database, \nthe migration will fail with an error, mentioning already existing users.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehrbase%2Fmigration-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fehrbase%2Fmigration-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehrbase%2Fmigration-tool/lists"}