{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "# Description\n`psql2mysql` provides some tooling for migrating data from PostgreSQL to\nMariaDB. It was main target for this tool is to migrate the databases of\nan [OpenStack](https://www.openstack.org) deployment from PostgreSQL to\nMariaDB. But it should work for other databases as well.\n\nThe tool itself is based on SQLalchemy and it's builtin type abstraction to\nhandle some of the differences between both database.\n\nCurrently its focused on moving from PostgreSQL to MariaDB. Other MySQL like\ndatabases haven't been tested yet. Neither is the reverse direction of the\nmigration (MariaDB to PostgreSQL) implemented. Both of these features should\nbe easy to add however.\n\n# Usage\n\n## Installation\n\n```\nmkdir venv\nvirtualenv venv\n. venv/bin/activate\npip install -r requirements.txt\npython setup.py install\n```\n\n## Prerequisites\n* Before using `psql2mysql` for migration, the destination database and all\n its tables need to exist already.\n* `psql2mysql` does not do any checks currently if the schema of the target\n and destination database are compatible. In the case of a migration of an\n OpenStack database it is assumed that the respective db_sync tool (e.g.\n `keystone-manage db_sync`) of the OpenStack service has been called before\n running `psql2mysql`.\n* The identity provided for the source database needs to have enough\n privileges to read all data and schema in the specified database.\n* Additionally to write access, the identity provided for the target database\n needs privileges to temporary disable constraints and foreign keys for the\n duration of the migration.\n\n## Commands\n`psql2mysql` currenty provides two subcommands:\n\n* `precheck`\n\n Runs a couple of checks on the tables of the source database. Currently\n only searches all text columns for characters that are not compatible with\n the \"utf8\" encoding of MariaDB. Prints out the rows (and affected columns)\n that contains incompatible strings.\n\n* `migrate`\n\n Runs the acutal migration. Will go through, the database table by table\n and migrate all rows to the target database.\n\n* `purge-tables`\n\n Purges all tables in the target database. Tables with names related to\n alembic and SQLalchemy-migrate are skipped and not purged. This subcommand\n can be executed optionally after a failed migration attempt. The `migrate`\n subcommand will also purge all tables in the target database in the same\n way before it starts to copy any data from the source database. But as\n that operation can take a significant amount of time it might make sense\n to run the `purge-tables` subcommand separately before `migrate` in order\n to reduce the overall downtime of the source database.\n\n### Options\n\n* `exclude-deleted`\n\n When migrating the data from source to target database, exclude soft-deleted\n rows. Set to true by default.\n\n* `batch`\n\n Process more databases in one run of `psql2mysql`. The argument for this option\n is a path to YML file that lists set of databases with their source and target\n connection strings. The format of YML file is:\n\n ```\n database1:\n source: source URI for database1\n target: target URI for database1\n database2:\n source: source URI for database2\n ...\n ```\n\n* `chunk-size`\n\n By default table migrations are broken into chunks, a number of rows at a\n time. The default size is `10000`. This option with change the chunk size.\n\n Breaking the migration into chunks improves RAM usage and allows the\n migration tool to work with larger databases.\n\n Setting `chunk-size` to `0` will disable chunking and the migration will\n migrate the whole table in one go. Be warned that this will use more RAM.\n\n## Examples\n\nTo check that it is actually possible to migrate run the `precheck`\nsubcommand:\n\n```psql2mysql --source postgresql://neutron:secret@192.168.1.1/neutron precheck```\n\nTo check all databases in the batch file:\n\n```psql2mysql --batch databases.yml precheck```\n\n\nTo do the actual migraton:\n```\n psql2mysql \\\n --source postgresql://neutron:secret@192.168.1.1/neutron \\\n --target mysql+pymysql://neutron:evenmoresecret@192.168.1.2/neutron?charset=utf8 \\\n migrate\n```\n\nTo migrate all databases in the batch file:\n\n```psql2mysql --batch databases.yml migrate```\n\n\n# Testing\n`psql2mysql` provides a test suite. To run the tests use:\n\n```nosetests```\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/SUSE/psql2mysql", "keywords": "", "license": "Apache-2", "maintainer": "", "maintainer_email": "", "name": "psql2mysql", "package_url": "https://pypi.org/project/psql2mysql/", "platform": "", "project_url": "https://pypi.org/project/psql2mysql/", "project_urls": { "Homepage": "https://github.com/SUSE/psql2mysql" }, "release_url": "https://pypi.org/project/psql2mysql/0.5.1/", "requires_dist": [ "oslo.config", "oslo.log", "psycopg2", "prettytable", "PyMySQL", "PyYAML", "rfc3986", "SQLAlchemy (<1.1.0,>=1.0.10)" ], "requires_python": "", "summary": "Copy data from PostgreSQL databases to MySQL", "version": "0.5.1" }, "last_serial": 4377029, "releases": { "0.4.0": [ { "comment_text": "", "digests": { "md5": "450bbd4b9421a07b271b588f32442424", "sha256": "4e97d5448812086d758eca412fec6265750bdbea6aab639e2ac473187da15844" }, "downloads": -1, "filename": "psql2mysql-0.4.0-py2-none-any.whl", "has_sig": false, "md5_digest": "450bbd4b9421a07b271b588f32442424", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 15518, "upload_time": "2018-10-08T07:31:38", "url": "https://files.pythonhosted.org/packages/d9/c2/2e5f60644333893b98316f99f1c2c8d0d44afb77525164a5df1c2ef2b4c3/psql2mysql-0.4.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6795e71441ffa8f0741cc4994809f8d9", "sha256": "2a1545bc6c8cec02a2049c1a522da963dc76398dee5e4bac176fd637e4d89015" }, "downloads": -1, "filename": "psql2mysql-0.4.0.tar.gz", "has_sig": false, "md5_digest": "6795e71441ffa8f0741cc4994809f8d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14775, "upload_time": "2018-10-08T07:31:40", "url": "https://files.pythonhosted.org/packages/0e/fe/2095af72af203cc72560278b429caa804d0a48a3e7c1b62b17fa8a39bfd8/psql2mysql-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "363c15f3dde0472af211d2439b8924a1", "sha256": "f96a98982ba5b0303259786b58fe6fa13f64d2da880d41539b56f96b0cd2ec6e" }, "downloads": -1, "filename": "psql2mysql-0.5.0-py2-none-any.whl", "has_sig": false, "md5_digest": "363c15f3dde0472af211d2439b8924a1", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 17576, "upload_time": "2018-10-09T09:32:38", "url": "https://files.pythonhosted.org/packages/bf/0f/ef1056d09f9f8f4e5716c4a185927d89b8609cd670c8549202d8025d8608/psql2mysql-0.5.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "920ec33290db3d358957222795594a82", "sha256": "bac5158a404b72d2bb0b33a2e08b19947233f84bdb1822cfe2d7db47edd5ccf3" }, "downloads": -1, "filename": "psql2mysql-0.5.0.tar.gz", "has_sig": false, "md5_digest": "920ec33290db3d358957222795594a82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16001, "upload_time": "2018-10-09T09:32:41", "url": "https://files.pythonhosted.org/packages/4b/01/d7d10d0b642ad0952abf2998e24a46fcd4363a29206fcf616783f9f9125e/psql2mysql-0.5.0.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "2d7b42776d89cb178d21b43afea4f5ce", "sha256": "fd0f444c78c974995eb64a6d2d04db070cd451a13f0348cd04cfc10e2dfa1133" }, "downloads": -1, "filename": "psql2mysql-0.5.1-py2-none-any.whl", "has_sig": false, "md5_digest": "2d7b42776d89cb178d21b43afea4f5ce", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 17602, "upload_time": "2018-10-15T10:24:19", "url": "https://files.pythonhosted.org/packages/41/de/b3d118050c1a91623b0f900ea8f7eb00774caef6094b3eb8642376c1940b/psql2mysql-0.5.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ac8a0a113ea831c7549f55ec0def4b01", "sha256": "28d60bb64b18c765831732b586e35260e48e8577b4fa28be469c725d4a858e61" }, "downloads": -1, "filename": "psql2mysql-0.5.1.tar.gz", "has_sig": false, "md5_digest": "ac8a0a113ea831c7549f55ec0def4b01", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16063, "upload_time": "2018-10-15T10:24:21", "url": "https://files.pythonhosted.org/packages/5f/12/dc2bde26dbc5658ffc4f6de8a60226dc035bf362f8fd0bf47c3d2c07427c/psql2mysql-0.5.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2d7b42776d89cb178d21b43afea4f5ce", "sha256": "fd0f444c78c974995eb64a6d2d04db070cd451a13f0348cd04cfc10e2dfa1133" }, "downloads": -1, "filename": "psql2mysql-0.5.1-py2-none-any.whl", "has_sig": false, "md5_digest": "2d7b42776d89cb178d21b43afea4f5ce", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 17602, "upload_time": "2018-10-15T10:24:19", "url": "https://files.pythonhosted.org/packages/41/de/b3d118050c1a91623b0f900ea8f7eb00774caef6094b3eb8642376c1940b/psql2mysql-0.5.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ac8a0a113ea831c7549f55ec0def4b01", "sha256": "28d60bb64b18c765831732b586e35260e48e8577b4fa28be469c725d4a858e61" }, "downloads": -1, "filename": "psql2mysql-0.5.1.tar.gz", "has_sig": false, "md5_digest": "ac8a0a113ea831c7549f55ec0def4b01", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16063, "upload_time": "2018-10-15T10:24:21", "url": "https://files.pythonhosted.org/packages/5f/12/dc2bde26dbc5658ffc4f6de8a60226dc035bf362f8fd0bf47c3d2c07427c/psql2mysql-0.5.1.tar.gz" } ] }