{ "info": { "author": "Philip Southam", "author_email": "philipsoutham@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Database", "Topic :: Utilities" ], "description": "========================================================================================\npy-mysql2pgsql - A tool for migrating/converting/exporting data from MySQL to PostgreSQL\n========================================================================================\n\nThis tool allows you to take data from an MySQL server (only tested on\n5.x) and write a PostgresSQL compatable (8.2 or higher) dump file or pipe it directly\ninto your running PostgreSQL server (8.2 or higher).\n\n.. attention::\n Currently there is no support for importing `spatial data from MySQL\n `_.\n\n\nInstallation:\n=============\n\nIf you're like me you don't like random stuff polluting your python\ninstall. Might I suggest installing this in an virtualenv?\n\n::\n\n > virtualenv --no-site-packages ~/envs/py-mysql2pgsql\n > source ~/envs/py-mysql2pgsql/bin/activate\n\n\nRequirements:\n-------------\n\n* `Python 2.6 or 2.7 `_\n* `MySQL-python `_\n* `psycopg2 `_\n* `PyYAML `_\n* `termcolor `_ (unless you're installing on windows)\n\n\nOn Windows\n----------\n\nI have only done limited testing on this platform using Python\n2.7. Here are the driver dependencies for windows, install these\nbefore attempting to install py-mysql2pgsql or it will fail.\n\n* `psycopg2 for Windows `_\n* `MySQL-python for Windows `_\n\n\n\nFrom PyPI:\n----------\n\nAll dependencies **should** be automatically installed when installing\nthe app the following ways\n\n::\n\n > pip install py-mysql2pgsql\n\n\nFrom source:\n------------\n\n::\n\n > git clone git://github.com/philipsoutham/py-mysql2pgsql.git\n > cd py-mysql2pgsql\n > python setup.py install\n\n\nUsage:\n======\n\nLooking for help?\n\n::\n\n > py-mysql2pgsql -h\n usage: py-mysql2pgsql [-h] [-v] [-f FILE]\n\n Tool for migrating/converting data from mysql to postgresql.\n\n optional arguments:\n -h, --help show this help message and exit\n -v, --verbose Show progress of data migration.\n -f FILE, --file FILE Location of configuration file (default:\n mysql2pgsql.yml). If none exists at that path,\n one will be created for you.\n \n\nDon't worry if this is your first time, it'll be gentle.\n\n::\n\n > py-mysql2pgsql\n No configuration file found.\n A new file has been initialized at: mysql2pgsql.yml\n Please review the configuration and retry...\n\nAs the output suggests, I file was created at mysql2pgsql.yml for you\nto edit. For the impatient, here is what the file contains.\n\n::\n\n # if a socket is specified we will use that\n # if tcp is chosen you can use compression\n mysql:\n hostname: localhost\n port: 3306\n socket: /tmp/mysql.sock\n username: mysql2psql\n password: \n database: mysql2psql_test\n compress: false\n destination:\n # if file is given, output goes to file, else postgres\n file: \n postgres:\n hostname: localhost\n port: 5432\n username: mysql2psql\n password: \n database: mysql2psql_test\n\n # if only_tables is given, only the listed tables will be converted. leave empty to convert all tables.\n #only_tables:\n #- table1\n #- table2\n # if exclude_tables is given, exclude the listed tables from the conversion.\n #exclude_tables:\n #- table3\n #- table4\n\n # if supress_data is true, only the schema definition will be exported/migrated, and not the data\n supress_data: false\n\n # if supress_ddl is true, only the data will be exported/imported, and not the schema\n supress_ddl: false\n\n # if force_truncate is true, forces a table truncate before table loading\n force_truncate: false\n\n\nPretty self explainitory right? A couple things to note, first if\n`destination -> file` is populated all outpute will be dumped to the\nspecified location regardless of what is contained in `destination ->\npostgres`. So if you want to dump directly to your server make sure\nthe `file` value is blank.\n\nSay you have a MySQL db with many, many tables, but you're only\ninterested in exporting a subset of those table, no problem. Add only\nthe tables you want to include in `only_tables` or tables that you\ndon't want exported to `exclude_tables`. \n\nOther items of interest may be to skip moving the data and just create\nthe schema or vice versa. To skip the data and only create the schema\nset `supress_data` to `true`. To migrate only data and not recreate the\ntables set `supress_ddl` to `true`; if there's existing data that you\nwant to drop before importing set `force_truncate` to\n`true`. `force_truncate` is not necessary when `supress_ddl` is set to\n`false`.\n\nOne last thing, the `--verbose` flag. Without it the tool will just go\non it's merry way without bothering you with any output until it's\ndone. With it you'll get a play-by-play summary of what's going\non. Here's an example.\n\n::\n\n > py-mysql2pgsql -v -f mysql2pgsql\n START PROCESSING table_one\n START - CREATING TABLE table_one\n FINISH - CREATING TABLE table_one\n START - WRITING DATA TO table_one\n 24812.02 rows/sec [20000] \n FINISH - WRITING DATA TO table_one\n START - ADDING INDEXES TO table_one\n FINISH - ADDING INDEXES TO table_one\n START - ADDING CONSTRAINTS ON table_one\n FINISH - ADDING CONSTRAINTS ON table_one\n FINISHED PROCESSING table_one\n\n START PROCESSING table_two\n START - CREATING TABLE table_two\n FINISH - CREATING TABLE table_two\n START - WRITING DATA TO table_two\n\n FINISH - WRITING DATA TO table_two\n START - ADDING INDEXES TO table_two\n FINISH - ADDING INDEXES TO table_two\n START - ADDING CONSTRAINTS ON table_two\n FINISH - ADDING CONSTRAINTS ON table_two\n FINISHED PROCESSING table_two\n\n\nData Type Conversion Legend\n===========================\n\nSince there is not a one-to-one mapping between MySQL and\nPostgreSQL data types, listed below are the conversions that are applied. I've\ntaken some liberties with some, others should come as no surprise.\n\n==================== ===========================================\nMySQL PostgreSQL\n==================== ===========================================\nchar character\nvarchar character varying\ntinytext text\nmediumtext text\ntext text\nlongtext text\ntinyblob bytea\nmediumblob bytea\nblob bytea\nlongblob bytea\nbinary bytea\nvarbinary bytea\nbit bit varying\ntinyint smallint\ntinyint unsigned smallint\nsmallint smallint\nsmallint unsigned integer\nmediumint integer\nmediumint unsigned integer\nint integer\nint unsigned bigint\nbigint bigint\nbigint unsigned numeric\nfloat real\nfloat unsigned real\ndouble double precision\ndouble unsigned double precision\ndecimal numeric\ndecimal unsigned numeric\nnumeric numeric\nnumeric unsigned numeric\ndate date\ndatetime timestamp without time zone\ntime time without time zone\ntimestamp timestamp without time zone\nyear smallint\nenum character varying (with `check` constraint)\nset ARRAY[]::text[]\n==================== ===========================================\n\n\nAbout:\n======\n\nI ported much of this from an existing project written in Ruby by Max\nLapshin over at ``_. I\nfound that it worked fine for most things, but for migrating large tables\nwith millions of rows it started to break down. This motivated me to\nwrite *py-mysql2pgsql* which uses a server side cursor, so there is no \"paging\"\nwhich means there is no slow down while working it's way through a\nlarge dataset.", "description_content_type": null, "docs_url": "https://pythonhosted.org/py-mysql2pgsql/", "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/philipsoutham/py-mysql2pgsql", "keywords": "mysql postgres postgresql pgsql psql migration", "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "py-mysql2pgsql", "package_url": "https://pypi.org/project/py-mysql2pgsql/", "platform": "any", "project_url": "https://pypi.org/project/py-mysql2pgsql/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/philipsoutham/py-mysql2pgsql" }, "release_url": "https://pypi.org/project/py-mysql2pgsql/0.1.5/", "requires_dist": null, "requires_python": null, "summary": "Tool for migrating/converting from mysql to postgresql.", "version": "0.1.5" }, "last_serial": 796847, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "6a5889ee8b7415af144c1c4c368c9035", "sha256": "a8701bb4429743cc10620b078182ff8fd0f51e5a121d54eea1e2cddcbb7f36c7" }, "downloads": -1, "filename": "py-mysql2pgsql-0.1.2.tar.gz", "has_sig": false, "md5_digest": "6a5889ee8b7415af144c1c4c368c9035", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 216590, "upload_time": "2011-08-18T22:25:52", "url": "https://files.pythonhosted.org/packages/71/33/f10444c1dcb23783b394a3beb9e0c95aacedfc83b1c8cd7c5fef68a89155/py-mysql2pgsql-0.1.2.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "f25690fdb8f55e9bae08237ed8ffa633", "sha256": "870c958fdfd137586864ddfb428a1bb2703b33e30b566daa9ac866a225c5374a" }, "downloads": -1, "filename": "py-mysql2pgsql-0.1.4.tar.gz", "has_sig": false, "md5_digest": "f25690fdb8f55e9bae08237ed8ffa633", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 109641, "upload_time": "2012-06-06T18:20:38", "url": "https://files.pythonhosted.org/packages/c6/81/35817d71c355326d6995a2de0bf1fbad3de2191c679a8abd09da971f4ff9/py-mysql2pgsql-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "f9383fc558dff6f6c1e304465ff702da", "sha256": "024d3f1d3994679421102a2cb70c1fde1306bdf8c70839db907a728324c65cdf" }, "downloads": -1, "filename": "py-mysql2pgsql-0.1.5.tar.gz", "has_sig": false, "md5_digest": "f9383fc558dff6f6c1e304465ff702da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 109642, "upload_time": "2012-06-06T18:24:36", "url": "https://files.pythonhosted.org/packages/28/49/c82e4313c63b26224950bef47ab19f52a921dd4c279abf31aa3ee9d9cbbe/py-mysql2pgsql-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f9383fc558dff6f6c1e304465ff702da", "sha256": "024d3f1d3994679421102a2cb70c1fde1306bdf8c70839db907a728324c65cdf" }, "downloads": -1, "filename": "py-mysql2pgsql-0.1.5.tar.gz", "has_sig": false, "md5_digest": "f9383fc558dff6f6c1e304465ff702da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 109642, "upload_time": "2012-06-06T18:24:36", "url": "https://files.pythonhosted.org/packages/28/49/c82e4313c63b26224950bef47ab19f52a921dd4c279abf31aa3ee9d9cbbe/py-mysql2pgsql-0.1.5.tar.gz" } ] }