mongodb-timemachine

Timemachine backup of mongodb database and restore

Usage no npm install needed!

<script type="module">
  import mongodbTimemachine from 'https://cdn.skypack.dev/mongodb-timemachine';
</script>

README

mongodb-timemachine

Backup and restore mongodb database for your local development. This package takes the backup of the database with a timestamp and then allows you to restore to latest/previous version as needed for development.

oclif Version Downloads/week License

Usage

// Installation
$ npm install -g mongodb-timemachine

// Initialise the timemachine and stores the connection configuration
// Only to be executed once
$ mongodb-timemachine init -uri=mongodb://localhost:27017/local

// Takes the current snapshot from the database
$ mongodb-timemachine snapshot

// Restores the latest snapshot to the database
$ mongodb-timemachine restore

// List all the snapshots
$ mongodb-timemachine ls

// Flush all the snapshot taken so far (except for the latest one)
$ mongodb-timemachine flus

Todo

  • Name based snapshot
  • Support multiple database (Currently only single database is supported)