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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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