Skip to content

CLI tool for cloning mongoDB database from one server to another

Notifications You must be signed in to change notification settings

fr1sk/mongo-clone

Repository files navigation

πŸ’Ύ mongo-clone

CLI tool for cloning mongoDB database from one server to another.
It is useful for DB backups from DB hostings that doesn't support free backup plan. (e.g. mlab)

πŸ”§ Installation

From npm (the recommended way):
npm i mongo-clone -g

or

From git repo:

  1. clone repo: git clone https://github.com/fr1sk/mongo-clone.git
  2. cd to repo: cd mongo-clone
  3. install mongo-clone: npm i -g

πŸ‘¨πŸ»β€πŸ’» Usage

Start cloning:
mongo-clone -s <SOURCE_MONGO_DB_URL> -t <TARGET_MONGO_DB_URL> [-f]
-s source mongoDB server that you want to clone from
-t target mongoDB server (empty DB) that you want to clone to
-f (optional) force deletion of target mongoDB before copying

Mongo URL example:
mongodb://USER:PASS@HOST:PORT/DBNAME

πŸ”Ž Other info - Good to know

  • It won't clone all of system.indexes! πŸ—‚οΈ
  • Keep in mind that this is beta version and if you have some problems please report it! My email is [email protected] πŸ“§
  • Feel free to contribute - just open PR! πŸ‘‹πŸ»
  • If you like it buy me a beer 🍺
    My BTC addresse: 1KUxHZT6H9aSHQrNZvb1qw6ZvRJ6VEApWu

πŸ‘¨πŸ»β€πŸ”§πŸ‘©πŸ»β€πŸ”§ Collaborators

Raschid J.F. Rafeally

πŸ“Ί Demo

mongo-clone demo1
mongo-clone: without arguments!

mongo-clone demo2
mongo-clone: cloning in progress!

mongo-clone demo3
mongo-clone: cloning completed!

About

CLI tool for cloning mongoDB database from one server to another

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published