{"id":16057944,"url":"https://github.com/pascalgn/dbmigration","last_synced_at":"2025-04-05T08:14:59.674Z","repository":{"id":120605501,"uuid":"97406055","full_name":"pascalgn/dbmigration","owner":"pascalgn","description":"Database migration tool","archived":false,"fork":false,"pushed_at":"2017-12-02T17:49:34.000Z","size":120,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T15:50:51.038Z","etag":null,"topics":["data-migration","database-migrations","migration","sql"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/pascalgn.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":"2017-07-16T19:29:12.000Z","updated_at":"2023-03-05T01:40:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"eec1c6a8-4633-42ad-8b21-187779ca7d16","html_url":"https://github.com/pascalgn/dbmigration","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalgn%2Fdbmigration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalgn%2Fdbmigration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalgn%2Fdbmigration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalgn%2Fdbmigration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pascalgn","download_url":"https://codeload.github.com/pascalgn/dbmigration/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305947,"owners_count":20917208,"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":["data-migration","database-migrations","migration","sql"],"created_at":"2024-10-09T03:05:32.343Z","updated_at":"2025-04-05T08:14:59.653Z","avatar_url":"https://github.com/pascalgn.png","language":"Kotlin","readme":"# Database migration tool\n\n[![Build Status](https://img.shields.io/travis/pascalgn/dbmigration.svg?style=flat-square)](https://travis-ci.org/pascalgn/dbmigration)\n[![License](https://img.shields.io/github/license/pascalgn/dbmigration.svg?style=flat-square)](LICENSE)\n\nA tool to export data from one SQL database and import it into another.\n\n## Usage\n\n    mkdir /tmp/db\n    vim /tmp/db/migration.properties\n    java com.github.pascalgn.dbmigration.Main migrate /tmp/db\n\n### Configuration\n\nIf no configuration file can be found, a default configuration file will be written.\nSee [migration-defaults.properties](src/main/resources/com/github/pascalgn/dbmigration/migration-defaults.properties) for more information.\n\n### JDBC drivers\n\nStandard [JDBC](https://en.wikipedia.org/wiki/Java_Database_Connectivity) will be used to access the databases.\n\nThe following drivers have been tested to work:\n\n- [H2](http://repo2.maven.org/maven2/com/h2database/h2/1.4.192/)\n- [MS SQL](http://repo2.maven.org/maven2/com/microsoft/sqlserver/mssql-jdbc/6.1.0.jre8/)\n- [Oracle](http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html) (registration required)\n\n### SSH tunnel\n\nTo connect to a database through an SSH tunnel, use the following command:\n\n    # forwards 127.0.0.1:12345 to sql-server:1433\n    ssh -N user@ssh-server -L 127.0.0.1:12345:sql-server:1433\n\nMake sure to also change your migration configuration accordingly:\n\n    ...\n    # host and port need to be separated by comma for MS SQL\n    source.jdbc.url=jdbc:sqlserver://127.0.0.1,12345;database=dbname\n    ...\n\n## Docker image\n\nThis tool is also available as a [docker image](https://hub.docker.com/r/pascalgn/dbmigration/):\n\n    $ mkdir /tmp/db\n    $ vim /tmp/db/migration.properties\n    $ docker run -v /tmp/db:/home/dbmigration/data pascalgn/dbmigration \\\n          migrate /home/dbmigration/data\n\nYou can use the `LOG_LEVEL` environment variable to change the log output:\n\n    $ docker run -e LOG_LEVEL=debug -v /tmp/db:/home/dbmigration/data pascalgn/dbmigration\n\nThe default level is `info`. For more information, see the [Dockerfile](src/build/Dockerfile).\n\n## Binary format\n\nThe exported files are gzip compressed and written in the following format:\n\n    \u003ccontent\u003e ::= \u003cversion\u003e \u003ctable-name\u003e \u003ccolumns\u003e \u003crows\u003e\n\n    \u003cversion\u003e ::= \"3\"\n\n    \u003ctable-name\u003e ::= \u003ctext\u003e\n\n    \u003ccolumns\u003e ::= \u003ccolumn-count\u003e { \u003ccolumn-name\u003e \u003ccolumn-sql-type\u003e }\n    \u003ccolumn-count\u003e ::= int\n    \u003ccolumn-name\u003e ::= \u003ctext\u003e\n    \u003ccolumn-sql-type\u003e ::= int\n\n    \u003crows\u003e ::= { \"1\" \u003crow\u003e }\n    ; each row contains exactly \u003ccolumn-count\u003e entries\n    \u003crow\u003e ::= { \u003crow-column\u003e }\n    \u003crow-column\u003e ::= \"0\" | \"1\" ( \u003ctext\u003e | \u003cnumber\u003e | \u003clength\u003e bytes | \u003cdate\u003e )\n\n    \u003ctext\u003e ::= \u003clength\u003e utf8-encoded-bytes\n    \u003clength\u003e ::= int\n    \u003cnumber\u003e ::= \u003cscale\u003e \u003clength\u003e bytes\n    \u003cscale\u003e ::= int\n    ; dates are represented as milliseconds since January 1, 1970\n    \u003cdate\u003e ::= long\n\nNote that the exported files may consist of multiple [gzip member](https://tools.ietf.org/html/rfc1952#page-5) entries.\n\n## License\n\nThis database migration tool is licensed under the Apache License, Version 2.0\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpascalgn%2Fdbmigration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpascalgn%2Fdbmigration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpascalgn%2Fdbmigration/lists"}