Giter Site home page Giter Site logo

mongoex's Introduction

mongoex - Yet another way to copy mongodb data

I've looked at options like mongomirror (which is for whole for whole cluster, not per database/collection). I've looked at mongodump and mongorestore but there require disk space on the server that's doing the migration and is not feasible if the data is larger than the server's disk space.

So mongoex is a combination of both mongodump and mongorestore without the need to use any disk space and can select per database/collection if you need to.

There is only one subcomamd at the moment which is "migrate". If you dig into the source codes you will find other subcommands but these are still a WIP.

Example for copying whole databases:

mongoex migrate -s mongodb+srv://yourusername:[email protected]/\?retryWrites=true\&w=majority -d mongodb+srv://yourusername:[email protected]/\?retryWrites=true\&w=majority --dbsrc sample_restaurants --dbdest sample_airbnb

Example for selective collections to copy:

mongoex migrate -s mongodb+srv://yourusername:[email protected]/\?retryWrites=true\&w=majority -d mongodb+srv://yourusername:[email protected]/\?retryWrites=true\&w=majority --dbsrc sample_restaurants --dbdest sample_airbnb -c collection1,collection2,collection3...

NOTE: -c flag for collection will get those collection from --dbsrc database

Try using --help flag to see the options, normally you will see this:

mongoex is a tool to migrate mongodb data in real time.
This tool helps to quickly do migrations to move data, especially from production to pre-prod for testing

Usage:
  mongoex [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  migrate     Migrates data from a source MongoDB to destination MongoDB

Flags:
  -h, --help   help for mongoex

Use "mongoex [command] --help" for more information about a command.

Doing automated Point-in-Time Recovery to a temporary cluster

NOTE: To do this, you need to enable API Access List for your API Key - https://mongodb.com/docs/atlas/configure-api-access/#std-label-enable-api-access-list

mongoex atlas pointintime --targetClusterName tempCluster --sourceProject YourSourceProject --sourceClusterName YourSourceClusterYouWantToRestoreFrom --targetProject YouTargetProject --time 1668040812

mongoex's People

Contributors

muhammadn avatar cheelim1 avatar

Watchers

 avatar Kostas Georgiou avatar Francis Huang avatar

Forkers

cheelim1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.