{"id":29112770,"url":"https://github.com/guy1998/sap-hana-data-migration","last_synced_at":"2026-04-27T18:04:13.841Z","repository":{"id":301162821,"uuid":"1008361632","full_name":"guy1998/sap-hana-data-migration","owner":"guy1998","description":"Handles migration of data between tables in two different SAP hana databases","archived":false,"fork":false,"pushed_at":"2025-06-25T13:27:08.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-25T13:32:01.594Z","etag":null,"topics":["database","migration-tool","sap-hana"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guy1998.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,"zenodo":null}},"created_at":"2025-06-25T12:29:20.000Z","updated_at":"2025-06-25T13:27:12.000Z","dependencies_parsed_at":"2025-06-25T13:33:02.379Z","dependency_job_id":"442bd696-1253-4954-ad98-26530c1dffdf","html_url":"https://github.com/guy1998/sap-hana-data-migration","commit_stats":null,"previous_names":["guy1998/sap-hana-data-migration"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/guy1998/sap-hana-data-migration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guy1998%2Fsap-hana-data-migration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guy1998%2Fsap-hana-data-migration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guy1998%2Fsap-hana-data-migration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guy1998%2Fsap-hana-data-migration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guy1998","download_url":"https://codeload.github.com/guy1998/sap-hana-data-migration/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guy1998%2Fsap-hana-data-migration/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262581282,"owners_count":23331908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["database","migration-tool","sap-hana"],"created_at":"2025-06-29T11:03:28.579Z","updated_at":"2026-04-27T18:04:13.811Z","avatar_url":"https://github.com/guy1998.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sap-hana-data-migration\nThis is a simple solution that handles migration of data between tables in two different SAP-hana databases. The migration is performed in batches which makes it ideal even for large amounts of data You can run it on your own machine as a simple python script or as a deployment in kubernetes. Both are explained below.\n\n# Running as a python script\nTo run this code as a python script all you have to do is specify the `.env` file (please check the section below on that). Then run the following command to install all libraries and dependencies (python 3.10 or newer required):\n```bash \npip install -r requirements.txt\n```\nThen you can simply start the script by executing the following command or in your preferred IDE (e.g PyCharm)\n```bash\npython main.py\n```\nNow you can relax and wait for the migration to finish.\n\n# Running it as a deployment in kubernetes\nTo run it as a Kubernetes deployment you can use the following `.yaml` template. Feel free to change the name of the deployment and of course do not forget to update your .env variables. In here I will specify my own docker image but you can of course create another one by forking this repo.\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: hana-migrator\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      app: hana-migrator\n  template:\n    metadata:\n      labels:\n        app: hana-migrator\n    spec:\n      containers:\n        - name: hana-migrator\n          image: ghcr.io/guy1998/sap-hana-data-migration:latest\n          imagePullPolicy: Always\n          env:\n            - name: SOURCE_ADDRESS\n              value: \"your.source.db.address\"\n            - name: SOURCE_PORT\n              value: \"30015\"\n            - name: SOURCE_USER\n              value: \"admin\"\n            - name: SOURCE_PASSWORD\n              value: \"admin_pass\"\n            - name: TARGET_ADDRESS\n              value: \"your.target.db.address\"\n            - name: TARGET_PORT\n              value: \"30015\"\n            - name: TARGET_USER\n              value: \"admin\"\n            - name: TARGET_PASS_WORD\n              value: \"admin_pass\"\n            - name: SOURCE_TABLE\n              value: \"MY_SCHEMA.SOURCE_TABLE\"\n            - name: TARGET_TABLE\n              value: \"MY_SCHEMA.TARGET_TABLE\"\n            - name: BATCH_SIZE\n              value: \"1000\"\n            - name: ORDER_BY\n              value: \"ID\"\n            - name: FILENAME\n              value: \"logfile.txt\"\n```\n# Environment variables\nThis application uses the following environment variables to configure the source and target SAP HANA database connections, table names, batching behavior, and logging.\n### Hana source configuration\n| Variable          | Description                          | Example              |\n| ----------------- | ------------------------------------ | -------------------- |\n| `SOURCE_ADDRESS`  | Hostname or IP of the source HANA DB | `source.hana.local`  |\n| `SOURCE_PORT`     | Port for source HANA DB              | `30015`              |\n| `SOURCE_USER`     | Username for source HANA DB          | `admin`              |\n| `SOURCE_PASSWORD` | Password for source HANA DB          | `my_secret_password` |\n### Hana target configuration\n| Variable           | Description                          | Example              |\n| ------------------ | ------------------------------------ | -------------------- |\n| `TARGET_ADDRESS`   | Hostname or IP of the target HANA DB | `target.hana.local`  |\n| `TARGET_PORT`      | Port for target HANA DB              | `30015`              |\n| `TARGET_USER`      | Username for target HANA DB          | `admin`              |\n| `TARGET_PASSWORD` | Password for target HANA DB          | `my_secret_password` |\n### Batch and table configuration\n| Variable       | Description                              | Example                 |\n| -------------- | ---------------------------------------- | ----------------------- |\n| `SOURCE_TABLE` | Full name of the source table            | `MY_SCHEMA.SOURCE_DATA` |\n| `TARGET_TABLE` | Full name of the target table            | `MY_SCHEMA.TARGET_DATA` |\n| `BATCH_SIZE`   | Number of rows per batch migration       | `1000`                  |\n| `ORDER_BY`     | Column name to order rows during reading | `ID`                    |\n\nWarning: ORDER_BY is crucial to the batching strategy with offset. I recommend putting there your primary key (composite PK like this 'key1, key2'). It is necessary so that we do not sample the same rows in 2 different batches. In other words it guarantees each batch is unique. \n### Logging\n| Variable   | Description                         | Example       |\n| ---------- | ----------------------------------- | ------------- |\n| `FILENAME` | Path or filename for the log output | `logfile.txt` |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguy1998%2Fsap-hana-data-migration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguy1998%2Fsap-hana-data-migration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguy1998%2Fsap-hana-data-migration/lists"}