Skip to content

Repository files navigation

mongocop logo

mongocop

Interactive CLI tool for copying MongoDB databases.

Install

curl -fsSL https://raw.githubusercontent.com/lnmunhoz/mongocop/main/install.sh | sh

Requires Node.js 18+.

Usage

mongocop

Check the installed version:

mongocop --version

Features:

  • 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_URL environment variable (takes priority over saved hosts)
  • Copies indexes along with documents
  • Overwrite confirmation before dropping existing data
  • Collection-level progress indicator

Development

pnpm install
pnpm start

Build

pnpm run build
node dist/index.js

Uninstall

rm -rf ~/.mongocop && rm /usr/local/bin/mongocop

To remove saved secrets from Keychain, open Keychain Access and delete items created by mongocop.

About

Interactive CLI tool for copying MongoDB databases.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages