This Repo includes some tools to make the work easer with MongoDB. Whether you're safeguarding your data with backups or restoring from previous backups, this repository should provide a versatile set of tools to simplify your workflow.
-
Backup Utility: Efficiently create backups of MongoDB databases with just a simple command. Protect your valuable data and ensure its availability in case of unforeseen circumstances.
-
Restore Tool (Planned): Seamlessly restore databases from previously created backups. Quickly recover from data loss or corruption incidents with minimal downtime.
To Create a backup you only need to build the javascript and run the cli.
npm install
to install all required packagesnpm run build
creates the javascript codenpm run db-backup
starts the backup process.
By default the CLI trys to read the configuration from the json file in config/db.config.json
- The json schema
{
"connectionString": "mongodb+srv://<myDatabaseUser>:<D1fficultP%40ssw0rd>@cluster0.example.mongodb.net/<database>?retryWrites=true&w=majority",
"zip": true
}
zip
-> Either create a zip or leave it in the temp dirconnectionString
Your connection string to the database you want to backup
The Backup will be safed in a .zip in backup
when zip
is true
. Or the json will be safed in temp
if zip
is false
- DatabaseRestore Command
- Rework the CLI file and create a better command handler
- Detailed Backup Informations (path, filename, size, collectionCount, time used (currently not done be the project)
If you want to contribute something, i am open for it