Interactive CLI tool for copying MongoDB databases.
curl -fsSL https://raw.githubusercontent.com/lnmunhoz/mongocop/main/install.sh | shRequires Node.js 18+.
mongocopCheck the installed version:
mongocop --versionFeatures:
- Copy entire databases or selected collections
- Copy on the same host or across different hosts
- Pick an existing target database or create a new one
- Save, rename, and delete named connections
- Save, rename, delete, and rerun copy templates
- Stores saved connection secrets in macOS Keychain
- Keeps only non-secret connection metadata in
~/.mongocop/config.json - Supports
MONGODB_URLenvironment variable (takes priority over saved hosts) - Copies indexes along with documents
- Overwrite confirmation before dropping existing data
- Collection-level progress indicator
pnpm install
pnpm startpnpm run build
node dist/index.jsrm -rf ~/.mongocop && rm /usr/local/bin/mongocopTo remove saved secrets from Keychain, open Keychain Access and delete items
created by mongocop.