{"id":21721458,"url":"https://github.com/informaticsmatters/docker-mysql-to-pg-migrator","last_synced_at":"2026-04-08T23:35:15.986Z","repository":{"id":80604881,"uuid":"268796873","full_name":"InformaticsMatters/docker-mysql-to-pg-migrator","owner":"InformaticsMatters","description":"A container image to migrate exported MySQL data into a PostgreSQL database","archived":false,"fork":false,"pushed_at":"2020-06-10T07:49:21.000Z","size":40221,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-01T20:49:43.087Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/InformaticsMatters.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-06-02T12:37:11.000Z","updated_at":"2020-06-10T07:49:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"bb4934cf-b9c8-484b-8c54-ccb12b35719b","html_url":"https://github.com/InformaticsMatters/docker-mysql-to-pg-migrator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/InformaticsMatters/docker-mysql-to-pg-migrator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Fdocker-mysql-to-pg-migrator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Fdocker-mysql-to-pg-migrator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Fdocker-mysql-to-pg-migrator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Fdocker-mysql-to-pg-migrator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InformaticsMatters","download_url":"https://codeload.github.com/InformaticsMatters/docker-mysql-to-pg-migrator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Fdocker-mysql-to-pg-migrator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31579056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":"2024-11-26T02:16:58.461Z","updated_at":"2026-04-08T23:35:15.970Z","avatar_url":"https://github.com/InformaticsMatters.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-mysql-to-pg-migrator\nA container image to migrate MySQL data into PostgreSQL.\n\nThis container expects a volume to be mounted at `/import`\nthat contains the exported MySQL data in the format of a tgz file. The file is expected to ba called:\n```\nfragalysis-prod-dump.tgz\n```\n\nThe `docker-entrypoint` will use this data and then employ `psql` to import the data into\nthe PostgreSQL database using the following environment variables: -\n\n- `POSTGRESQL_USER`\n- `POSTGRESQL_PASSWORD`\n- `POSTGRESQL_HOST`\n- `POSTGRESQL_PORT`\n- `POSTGRESQL_DATABASE`\n\nTo obtain the input data:\n- Identify mysql export directory with: mysql\u003e SHOW VARIABLES LIKE \"secure_file_priv\";\n- Create a dump of data files in tab separated format (and separate ddl files) as follows:\n```\nmysqldump --compatible=postgres mysql -T/var/lib/mysql-files -uroot -p\"\u003cpassword\u003e\"\n```\n\nFor deployment see our peer [Ansible] repository.\n\n---\n[ansible]: https://github.com/InformaticsMatters/docker-mysql-to-pg-migrator-ansible\n\n\n## Constraints\n\nThe constraints for the database are dropped before the dataload and recreated afterwards.\nFor future reference, (Postgres) SQL statements are as follows:\n\n```\nSELECT 'ALTER TABLE '||nspname||'.'||relname||' DROP CONSTRAINT IF EXISTS '||conname||';'\nFROM pg_constraint\nINNER JOIN pg_class ON conrelid=pg_class.oid\nINNER JOIN pg_namespace ON pg_namespace.oid=pg_class.relnamespace\nORDER BY CASE WHEN contype='f' THEN 0 ELSE 1 END,contype,nspname,relname,conname;\n\nSELECT 'ALTER TABLE '||nspname||'.'||relname||' ADD CONSTRAINT '||conname||' '|| pg_get_constraintdef(pg_constraint.oid)||';'\nFROM pg_constraint\nINNER JOIN pg_class ON conrelid=pg_class.oid\nINNER JOIN pg_namespace ON pg_namespace.oid=pg_class.relnamespace\nORDER BY CASE WHEN contype='f' THEN 0 ELSE 1 END DESC,contype DESC,nspname DESC,relname DESC,conname DESC;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finformaticsmatters%2Fdocker-mysql-to-pg-migrator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finformaticsmatters%2Fdocker-mysql-to-pg-migrator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finformaticsmatters%2Fdocker-mysql-to-pg-migrator/lists"}