Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
s3-mongo-restore
Advanced tools
Restore MongoDB Backups stored in S3, Using a CLI or directly in your code using this as a library
Usage
$ s3mr [<mongodburi|accessKey|secretKey|bucketName> ...]
Options
-u, --uri MongoDB URI
-a, --accessKey S3 Access Key
-s, --secretKey S3 Secret Key
-b, --bucketName S3 Bucket Name
-r, --region S3 Region
-lff, --load-from-file Load Configuration from a JSON file
Configuration File Example
{
mongodb: "mongodb://localhost:27017",
s3: {
secretKey: "<s3 secret key>",
accessKey: "<s3 access key>",
region: "<s3 region>",
bucketName: "<s3 bucket name>"
}
}
const restore = require('s3-mongo-restore');
var restoreConfig = {
mongodb: "mongodb://localhost:27017", // MongoDB URI
s3: {
secretKey: "<s3 secret key>", // S3 Secret Key
accessKey: "<s3 access key>", // S3 Access Key
region: "<s3 region>", // S3 Region
bucketName: "<s3 bucket name>" // S3 Bucket Name
}
}
This module exposes two functions, List
and Restore
. List
is used to list all the backups in the database and takes just the configuration object. Restore
is used to restore a database and takes the configuration object and the name of database.
//List
restore.List(restoreConfig)
.then(result => {
// When everything is ok, result is an Object containing information about all the backups
console.log(result);
}, error => {
// When Anything goes wrong!
console.log(error);
});
//Restore
restore.Restore(restoreConfig, "<A backup name>")
.then(result => {
console.log(result);
}, error => {
console.log(error);
});
See examples directory for more examples
MIT
This module uses mongorestore
to restore database, You need to have it installed on the machine on which you are using this module.
To backup the databases,
mongodump --host localhost --port=27017 --gzip --archive=<path to backup.gz>
// or, in mongodump version 3.4+
mongodump --uri=\<MongoDB URI\> --gzip --archive=<path to backup.gz>
FAQs
Restore MongoDB Backups stored on S3 with a (Optional) Web GUI
The npm package s3-mongo-restore receives a total of 0 weekly downloads. As such, s3-mongo-restore popularity was classified as not popular.
We found that s3-mongo-restore demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.