How to properly restore Couchbase backup to another server?


#1

I have Couchbase single-node-cluster A and B. Both have the same configuration. Except “A” has NO buckets, whereas “B” has 3 buckets with documents in each.

I use cbbackup to back up all buckets in “B”.

How do I properly restore this backup to “A”? From the docs on cbrestore, I must create the buckets on the destination first:

cbrestore --help
Usage: cbrestore [options] backup_dir destination
Restores a single couchbase bucket.
Please first create the destination / bucket before restoring.

Where is the metadata (configuration data such as bucketType, replicaNumber, quota, etc.) for each bucket in the backup? I see some resemblance of it in the .cbb file, but this is the raw data. Furthermore, this would be difficult to parse.

I could get the metadata via Couchbase REST => http://localhost:8091/pools/default/buckets

This leads me to my next question… given this metadata, what is the recommended approach for creating the destination buckets? CLI vs. API?

Finally, are there any plans to support destination buckets for cbrestore?

Thanks,

  • Michael

#2

I recreated the bucket on ‘B’ with the same general settings using the REST API. However, setting autoCompaction using the REST API does not work.

Here’s the documentation:
http://docs.couchbase.com/couchbase-manual-2.2/#couchbase-admin-rest-auto-compaction

I opened a bug for this:
http://www.couchbase.com/issues/browse/MB-10719

Please advise. Thanks.


#3

I recreated the bucket on ‘B’ with the same general settings using the REST API. However, setting autoCompaction using the REST API does not work.

Here’s the documentation:
http://docs.couchbase.com/couchbase-manual-2.2/#couchbase-admin-rest-auto-compaction

I opened a bug for this:
http://www.couchbase.com/issues/browse/MB-10719

Please advise. Thanks.


#4

The simplest approach is to just create the buckets on the ‘B’ with the same general settings as the ‘A’ cluster (size/replicas/etc.). Using ‘cbrestore’ will restore all of the views and other information. To keep them in ‘sync’ you may want to check out XDCR to replicate information from ‘A’ to ‘B’ automatically and in realtime.