Git Product home page Git Product logo

backup-cloudant's Introduction

CouchDB Backup & Cloud Object Storage Overview

This web application is intended to backup all documents in a CouchDB database, such as Cloudant, to IBM Cloud Object Storage for IBM Cloud.

For detailed information about how to perform these operations, see the developerWorks recipe that uses this project.

It can be run in IBM Cloud or in other environments that support Node.js runtimes and can install the necessary node module dependencies.

If running in IBM Cloud and using Bound Object Storage and/or Cloudant Instances:

The application will read in the credentials for these services using the information from the VCAP Services data. The only value you would need to supply in the file is the name of the database to be backed up.

If using non-bound CouchDB and Object Storage instances:

The information in the manifest will need to be overwritten with the credentials from the remote targets.

How does it work?

The primary mechanism in this application is a call to the couchbackup node module, which gets all documents from the specified database, and stores them in a text file. Once complete, the .txt file is uploaded to Object Storage for IBM Cloud, with the name of the file as the timestamp of the transaction, inside of a container named by the YEAR-MONTH convention.

The default is to run the backup job once every 24 hours, or every 86400000 milliseconds, but this is easy to modify in the manifest.

How to Restore:

In order to restore a database, see the couchbackup tutorial for detailed information. Since restoration should not be a regular occurrence, it is not automated in this application.

The first step is to get the desired .txt file that will be used to restore - this can be done using the Object Storage user interface, or by using tools that directly connect to the Swift back end to get the file.

Once you have the file, make sure that the couchdb node module is installed globally, and run the following command:

cat <filename>.txt | env COUCH_URL=<couchdb_url> couchrestore --db <name of existing db to restore>

One very important stipulation - the database that is being restored must exist before this command will work. If the database does not exist, the restore will not work. Additionally, it is best practice to restore to a new, empty database, rather than attempt to overwrite

backup-cloudant's People

Contributors

stefanvogel65 avatar

Watchers

 avatar Christian Compton avatar

backup-cloudant's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.