# grunt-mongo-backup

> Grunt task for managing mongodb backups

Latest version **0.0.2** (published 2014-06-29) · 0 weekly downloads

## Install

```sh
npm install grunt-mongo-backup
pnpm add grunt-mongo-backup
yarn add grunt-mongo-backup
bun add grunt-mongo-backup
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2014-06-29 |
| First published | 2014-06-29 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10.22 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Shane O'Grady |
| Maintainers | seogrady |
| Keywords | gruntplugin, grunt, mongodb, mongo, dump, restore, import, export |

## Links

- npm: https://www.npmjs.com/package/grunt-mongo-backup
- Repository: https://github.com/seogrady/grunt-mongo-backup
- Issues: https://github.com/seogrady/grunt-mongo-backup/issues
- npm.io page: https://npm.io/package/grunt-mongo-backup

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [@temporal-architect/claude-plugin](https://npm.io/package/@temporal-architect/claude-plugin.md) — 335 weekly downloads

## Recent versions

- 0.0.2 (latest) — 2014-06-29
- 0.0.1 — 2014-06-29

## README

# grunt-mongo-backup

Import and export data into mongodb using mongobackup.  This grunt task is a simple wrapper around mongodump and mongorestore.  It's a great way to configure your backups and share data.

## Getting Started
This plugin requires Grunt `~0.4.5

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```
npm install grunt-mongo-backup --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```
grunt.loadNpmTasks('grunt-mongo-backup');
```

## The mongobackup task

### Overview
In your project's Gruntfile, add a section named `mongoimport` to the data object passed into `grunt.initConfig()`.

```
grunt.initConfig({
  mongobackup: {
    options: {
      host : 'localhost',
      port: '27017',
      db : 'database-dev', 
      dump:{
        out : './dump',
      },    
      restore:{
        path : './dump/database-dev',          
        drop : true
      }
    }  
  }
});
```

## Basic Usage

### Mongodb Dump 
```
grunt mongobackup:dump
```

### Mongodb Restore 
```
grunt mongobackup:restore
```

## Options

Consult mongodb docs - mongodump and mongorestore for optional params.  

NOTE: NOT ALL OPTIONS ARE AVAILABLE.  Change to suit your needs.

---
_Source: https://npm.io/package/grunt-mongo-backup · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
