Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lanyrd/mysql-postgresql-converter
Lanyrd's MySQL to PostgreSQL conversion script
https://github.com/lanyrd/mysql-postgresql-converter
Last synced: 20 days ago
JSON representation
Lanyrd's MySQL to PostgreSQL conversion script
- Host: GitHub
- URL: https://github.com/lanyrd/mysql-postgresql-converter
- Owner: lanyrd
- License: bsd-2-clause
- Created: 2012-11-13T14:41:20.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2022-09-16T22:15:00.000Z (about 2 years ago)
- Last Synced: 2024-10-01T22:03:47.162Z (about 1 month ago)
- Language: Python
- Size: 50.8 KB
- Stars: 1,284
- Watchers: 49
- Forks: 462
- Open Issues: 31
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- starred-awesome - mysql-postgresql-converter - Lanyrd's MySQL to PostgreSQL conversion script (Python)
README
MySQL to PostgreSQL Converter
=============================Lanyrd's MySQL to PostgreSQL conversion script. Use with care.
This script was designed for our specific database and column requirements -
notably, it doubles the lengths of VARCHARs due to a unicode size problem we
had, places indexes on all foreign keys, and presumes you're using Django
for column typing purposes.How to use
----------First, dump your MySQL database in PostgreSQL-compatible format
mysqldump --compatible=postgresql --default-character-set=utf8 \
-r databasename.mysql -u root databasenameThen, convert it using the dbconverter.py script
`python db_converter.py databasename.mysql databasename.psql`
It'll print progress to the terminal.
Finally, load your new dump into a fresh PostgreSQL database using:
`psql -f databasename.psql`
More information
----------------You can learn more about the move which this powered at http://lanyrd.com/blog/2012/lanyrds-big-move/ and some technical details of it at http://www.aeracode.org/2012/11/13/one-change-not-enough/.