Search:

Search all manuals
Search this manual
Manual
Membase Manual 1.7
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
4.7 Backup and Restore with Membase
Chapter Sections
Chapters

4.7.2. Restore in 1.7.0

4.7.2. Restoring a Membase Server cluster to a previous state
4.7.2. Linux
4.7.2. Windows

This section provides information on the restore process for Membase Server up to and including 1.7.0. For information on using the restore functionality in Membase Server 1.7.1, see Section 4.7.3, “Restore in 1.7.1 and higher”.

Warning

It is a best practice to backup and restore all nodes together to minimize any inconsistencies in data. Membase is always per-item consistent, but does not guarantee total cluster consistency or in-order persistence.

Restoring a Membase Server cluster to a previous state

If you want to restore a Membase Server cluster to a previous state:

Stop the Membase Server service, replace the database and configuration files and restart the service. This must be performed on all nodes.

Restoring a Membase Server cluster using the mbrestore tool

If you are unable to meet the above requirements for restoring a cluster, you can use the mbrestore tool. This script will read the key-value pairs from a set of database files and send them as client commands into a bucket of your choosing.

This is useful if:

The mbrestore tool provides the following options:

mbrestore opts db_files (use -h for detailed help)
-a --add Use add instead of set to avoid overwriting existing items
-H --host Hostname of moxi server to connect to (default is 127.0.0.1)
-p --port Port of moxi server to connect to (default is 11211)
-t --threads Number of worker threads
-u --username Username to authenticate with (this is the name of the bucket you are sending data into)
-P --password Password to authenticate with (this is the password of the bucket you are sending data into)

Depending on the amount of data, this script can take an extended amount of time to run. It is a best practice to make sure that your connection to the server running the script is not broken, or that you are using something to let the script run in the background (i.e. screen)

Linux

/opt/membase/bin/ep_engine/management/mbrestore -a default default -0.mb default-1.mb default-2.mb
                                     default-3.mb

Warning

In order to correctly restore you must put all of the database backup file names as command arguments

Windows

shell> cd "C:/Program Files/Membase/Server/bin/ep-engine/management/"
.\mbrestore -a "C:/backup/2010-12-22/default" "C:/backup/2010-12-22/default-0.mb" \
   "C:/backup/2010-12-22/default-1.mb" "C:/backup/2010-12-22/default-2.mb" "C:/backup/2010-12-22/default-3.mb"

Warning

In order to correctly restore you must put all of the database backup file names as command arguments