Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Migranite -- manage migtations tool

Project Description

Tool for manage migrations in your project.


pip install migranite

If you want to use MongoDB as database for migrations:

pip install 'migranite[mongo]'

How to start

To initialize the migranite in your project run:

migranite init --migrations migrations_dir --templates templates_dir

This command creates the config file (.migranite) and two directories (migrations_dir and templates_dir).

Create the first migration:

migranite create my-first-migration

This is create the file migrations_dir/ with an empty migration. You need to write a module docstring and implement function run() with your migration logic.

Show the available migrations with statuses:

migranite list

Run all migrations that haven’t been started earlier:

migranite run

Run only specified migrations:

migranite run my-first-migration

Run the migrations that were started earlier:

migranite run --force my-first-migration

Config file

A config file is a simple ini-file with three sections.


Migrations settings.

path:Path to directory with migrations.
digits:Number of digits in migration number. Default 3.


Templates settings.

path:Path to directory with templates.
default:Default template file name.


Database settings. Currently only JSON file and MongoDB is supported.

backend:Type of database backend (json or mongo).

Other settings are backend-specified.


path:path to json file.


host:Hostname or ip address. Default localhost.
port:Default 27017.
name:Name of database. Required.
collection:Name of collection. Default migrations.

Release History

This version
History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(7.0 kB) Copy SHA256 Hash SHA256
Source Jan 5, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting