A data migration tool built to make migrating entire databases as simple as writing json migration rules. MySQL, Sqlite and Postgres are supported.
A simple migration rule:
{ "profiles": { "sources": [ {"table": "users"}, {"table": "addresses", "on":"user"} ], "transform": { "name": "username", "city": "addresses.city" } } }
This would migrate data to the profiles table, using data from users and joined addresses. In the transform section, we specify which fields we actually want to migrate.
In this case users.username would be migrated to name and addresses.city to city.
Ensure that you have the necessary database drivers. You will need psycopg for postgres and PyMySQL for MySql
Install from pip:
pip install magnivore
Configure magnivore. You can generate a skeleton config file with:
magnivore config-skeleton
Initialize magnivore:
magnivore init
Say hello:
magnivore hello
You have successfully installed magnivore! You can now write migration rules and execute them with:
magnivore run myrules.json
You can find the full documentation at http://magnivore.readthedocs.io
Currently there is poor support for table names that contain dashes, so ensure that your table names have no dashes.