Code Monkey home page Code Monkey logo

cb-backup's Introduction

Couchbase Backup

This script is using cbtransfer.exe which is installed on machines with Couchbase.

cbtransfer and backup.cmd

The command details are in backup.cmd. You need to change this file to if Coucbase is installed on another drive than D: This script will call cbtransfer.exe and will only back up keys starting with NHA_

backup.ps1 and sqlite

backup.ps1 calls the backup.cmd and then it extracts the backup data into .csv files using sqlite. The couchbase backup files are sqlite compatible and will be called data-0000.cbb

You will need to modify the .ps1 file to set the backupPath and server variables

$server = "10.120.2.23" #your server
$backupPath = "C:\Users\jlaszlo\Desktop\a" #your backup path

If you want to backup to a share you need to map it as a drive on Windows

Folder structure

When you run the script the first time it will create a full backup. Every new run create a diff backup. The full and diff backups will be under your backup folder and the generated day folder.

[backup folder]
└───[day folder]
    ├───[run datetime]-full
    │   └───bucket-[bucket name]
    │       └───node-[node name]
    └───[run datetime]-diff
        └───bucket-[bucket name]
            └───node-[node name]

Example

C:\USERS\JLASZLO\DESKTOP\A
└───2017-08-04T072812Z
    ├───2017-08-04T072812Z-full
    │   └───bucket-ycs
    │       └───node-bk-qalmc-1002.agoda.local%3A8091
    └───2017-08-04T072841Z-diff
        └───bucket-ycs
            └───node-bk-qalmc-1002.agoda.local%3A8091

Backup files

Under bucket-[bucket name] you fill find the following files

  • data-0000.cbb - sqlite backup
  • cbb_meta.csv - the meta table as CSV from the sqlite database
  • cbb_msg.csv - the document table as CSV from the sqlite database. This will have the json, expiration, etc

cb-backup's People

Contributors

jenol avatar

Watchers

 avatar

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.