{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreif3wkx7q35ehfvukcnvgocs5vx5x63evbg7sfdaov34xl3hnz7wny",
"uri": "at://did:plc:25rdn5elo5izoxrmtis34zuk/app.bsky.feed.post/3mp4egqtoxdx2"
},
"coverImage": {
"$type": "blob",
"ref": {
"$link": "bafkreihd4syowyu35o6n3rkawqle3shei3e4ow6d6tamt4j7brktzl2s3q"
},
"mimeType": "image/webp",
"size": 94708
},
"path": "/santosh327/moving-from-migrate-mongo-to-mongo-migrate-kit-mmk-without-re-running-old-migrations-19j8",
"publishedAt": "2026-06-25T11:34:10.000Z",
"site": "https://dev.to",
"tags": [
"database",
"mongodb",
"node",
"npm",
"https://mongo-migrate-kit.vercel.app/guide/migrate-mongo",
"https://www.npmjs.com/package/mongo-migrate-kit",
"https://github.com/santosh327/mongo-migrate-kit"
],
"textContent": "If you're using **migrate-mongo** and considering a switch, the biggest concern usually isn't features.\n\nIt's this:\n\n**\"Will I have to re-run old migrations or risk production data?\"**\n\nThe short answer is no.\n\nI built **mongo-migrate-kit** with migration adoption as a first class feature because switching migration tools shouldn't feel risky.\n\n## The Problem\n\nMost teams already have months or years of migration history.\n\nRe-running old migrations is dangerous.\n\nEditing migration records manually is even worse.\n\nWhat you really want is a way to tell the new tool:\n\n> \"These migrations already ran. Start tracking them and leave everything else alone.\"\n\nThat's exactly what `mongo-migrate-kit` does.\n\n## Import Existing migrate-mongo History\n\nFirst, install the package:\n\n\n\n npm install mongo-migrate-kit mongodb\n\n\nPreview the import:\n\n\n\n npx mmk import --dry-run\n\n\nThis reads your existing `migrate-mongo` changelog and shows what will be imported.\n\nNothing is written to the database.\n\nOnce you're happy with the output:\n\n\n\n npx mmk import\n\n\nThe migration history is copied into `mongo-migrate-kit`'s tracking collection.\n\nYour original `migrate-mongo` changelog remains untouched.\n\n## What Happens Next?\n\nAfter importing:\n\n\n\n npx mmk status\n\n\nPreviously applied migrations appear as applied.\n\nAny migration files that haven't run yet remain pending.\n\nWhen you run:\n\n\n\n npx mmk up\n\n\nOnly pending migrations execute.\n\nOld migrations are never re-run.\n\n## Why I Built This\n\nI originally created `mongo-migrate-kit` after running into rollback issues during a deployment.\n\nWhile using `migrate-mongo`, I found myself wanting more control over migration safety and deployment workflows.\n\nThat led to features such as:\n\n * Rollback specific migrations or batches\n * Dry-run support\n * SHA-256 checksum validation\n * Distributed migration locking\n * Redo support\n * TypeScript support\n * Safe migration adoption from migrate-mongo\n\n\n\n## Documentation\n\nGetting started takes only a few minutes:\n\nDeep dive on migration guide from migrate mongo:\nhttps://mongo-migrate-kit.vercel.app/guide/migrate-mongo\n\nnpm:\nhttps://www.npmjs.com/package/mongo-migrate-kit\n\nGitHub:\nhttps://github.com/santosh327/mongo-migrate-kit\n\n## Final Thoughts\n\nMigration tools should make deployments safer, not add anxiety.\n\nIf you're looking for a **migrate-mongo alternative** or need a **MongoDB migration tool for Node.js** that can adopt existing migration history safely, give **mongo-migrate-kit** a try.",
"title": "Moving from Migrate Mongo to Mongo Migrate Kit (mmk) Without Re Running Old Migrations"
}