Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

laget-se/mongo-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

[mongo-sync]

Sync MongoDB Databases in Bash.!

Usage

  • Download / Clone the script

    git clone https://github.com/laget-se/mongo-sync.git
    cd mongos
  • Edit config.yml and insert your configuration details

  • Use the script like this:

     ./mongos push [options]    # Push DB to Destination
     ./mongos pull [options]    # Pull DB from Source
     ./mongos sync [options]    # Pull & Push
     ./mongos clean [options]   # Cleanup, removes all pulled data
  • Options

     -y (--yes)                     # Skip confirmation
     -c (--config) file.yml         # Use alternative config file
    

Notes

  • mongos requires mongodump and mongorestore binaries to be installed in your system. If you have mongodb installed, then you probably already have them
  • Pushing/Synchronizing overwrites the destination DB
  • It's a good idea to keep your alternative/custom config.yml in .gitignore if you're using it inside some other project

TODO

  • Add a backup command and an --auto-backup feature

Contributing

  1. Fork it
  2. Create your feature/fix branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. Create a new Pull Request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages