EVERYTHING XIAOMI
Get listed

migrate-mongo

migrate-mongo is a code-based database migration tool for MongoDB projects running in Node.js.

Place
#21 of 32
Score
5.8
migrate-mongo's website

What migrate-mongo is

migrate-mongo is a code-based database migration tool for MongoDB projects running in Node.js. Its command-line interface can initialize a project, create migrations, apply pending changes, undo the latest applied migration, and display migration status. Migration scripts define `up` and `down` functions to apply changes and, where possible, reverse them. The tool records completed migrations in a configurable MongoDB changelog collection; configuration can also define a lock collection and its time to live, with 0 disabling that feature. New projects use CommonJS by default, with ECMAScript Modules also supported. Scripts can use Node.js modules and npm packages installed in the migration project. They can also access MongoDB transactions through the supplied MongoClient, which requires MongoDB 4.0 or later and migrate-mongo 7.0.0 or later. An optional file-hash setting can rerun changed migration files if scripts are safe to execute again. The listed requirements are Node.js 20 or later and MongoDB versions 4.x through 7.x. The project is free, MIT-licensed, and intended for Linux or self-hosted use. If a migration fails, it stops rather than continuing with other pending migrations.

Good

  • CLI can create, apply, undo, and list migrations.
  • Migration scripts support up and down functions.
  • Records applied migrations in a configurable collection.
  • Supports CommonJS and ECMAScript Modules.
  • MIT-licensed and free.

Watch out

  • Requires Node.js 20 or later.
  • Listed MongoDB versions are 4.x through 7.x.
  • A failed migration stops remaining pending migrations.
  • Changed files must be safe to rerun when using file hashes.

Who it suits

It suits Node.js developers who need to track and apply code-based MongoDB schema or data changes. It is intended for Linux or self-hosted use.

Verdict

migrate-mongo provides migration tracking and rollback commands for MongoDB projects, with migration scripts written in Node.js. Check the runtime and database requirements, and plan for a failed migration to halt the remaining queue.

Plans and prices

From migrate-mongo's own pricing page, checked 4 Oct 2026.

All about pricing
PlanPriceWhat it gives you
migrate-mongoFreeMIT-licensed · Node.js >=20.0.0 · MongoDB 4.x, 5.x, 6.x, or 7.x

The facts

Each one read from migrate-mongo's own pages, with the date it was checked.

What it does

Customization
Actions other than init accept options for a custom configuration file and a custom migrations directory.checked 4 Oct 2026
Error behavior
If a migration fails, migrate-mongo stops without continuing through the remaining pending migrations.checked 4 Oct 2026
File hashes
An optional file-hash setting lets changed migration files run again, provided scripts are written to be safely rerunnable.checked 4 Oct 2026
Integrations
Migration scripts can use Node.js modules and installed npm packages from the migration project's package.json.checked 4 Oct 2026
License
The repository identifies the project as MIT licensed.checked 4 Oct 2026
Locking
The configuration supports a lock collection and a lock TTL, with a TTL value of 0 disabling the feature.checked 4 Oct 2026
Maintainer
The package metadata names Sebastian Van Sande as author.checked 4 Oct 2026
Migration commands
Its CLI can initialize a project, create migrations, apply pending migrations, undo the last applied migration, and show migration status.checked 4 Oct 2026
Migration tracking
Applied changes are recorded in a configurable MongoDB changelog collection.checked 4 Oct 2026
Module formats
New projects default to CommonJS, with ECMAScript Modules also supported.checked 4 Oct 2026
Purpose
migrate-mongo is a database migration tool for MongoDB running in Node.js.checked 4 Oct 2026
Requirements
The README lists Node.js 20 or higher and MongoDB versions 4.x through 7.x as requirements.checked 4 Oct 2026
Reversible migrations
Migration scripts provide up and down functions for applying and, where possible, rolling back changes.checked 4 Oct 2026
Transactions
Migration scripts can use MongoDB's Transactions API through the supplied MongoClient, requiring MongoDB 4.0 or higher and migrate-mongo 7.0.0 or higher.checked 4 Oct 2026

Alternatives to migrate-mongo

All alternatives
  1. 1Atlas logo

    Atlas

    Free planOpen sourceWebAPILinuxmacOS
    8.3From $39 a month
  2. 2

    DeepFilterNet

    Free planOpen sourceAPILinuxmacOSSelf-hosted
    7.6Free plan
  3. 3

    pgroll

    Free planOpen sourceLinuxmacOSSelf-hostedWindows
    7.3Free plan
  4. 4Skeema logo

    Skeema

    Free planLinuxmacOSWindows
    6.9From $649 a year
  5. 5Bytebase Enterprise logo

    Bytebase Enterprise

    Free planWebAPISelf-hosted
    6.8From $20 a month
  6. 6

    Sqitch

    Free planLinuxmacOSSelf-hostedWindows
    6.7Free plan