Kartik Jain
Kartik Jain

Reputation: 109

Unable to restore couchbase bucket using cbrestore

I am using Couchbase Server version 4.5.0 and trying to restore a saved backup version onto my local CB server. I am using macOS Sierra Xcode Development tools are up to date Python v2.7.10

I First created a backup by using this command

sudo ./cbbackup HOST:PORT ~/Documents/ -u ‘username’ -p ‘password‘ -b BUCKET_NAME

After this I tried restoring this backup onto local Couchbase server using this command

  sudo ./cbrestore /path/to/backup/2017-01-24T121528Z/2017-01-24T121528Z-full/ http://localhost:8091 -u ‘USERNAME’ -p ‘PASSWORD’ --bucket-source=SOURCE_BUCKET_NAME --bucket-destination=DESTINATION_BUCKET_NAME

but I am getting following error.

Exception in thread s0:
Traceback (most recent call last):

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)

File "/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/lib/python/pump_mc.py", line 91, in run
rv, batch, need_backoff = self.scatter_gather(mconns, batch)

File "/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/lib/python/pump_cb.py", line 72, in scatter_gather
rv, conn = self.find_conn(mconns, vbucket_id, msgs)

File "/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/lib/python/pump_cb.py", line 316, in find_conn
host_port = serverList[vBucketMap[vbucket_id][0]]

IndexError: list index out of range

Upvotes: 2

Views: 1789

Answers (1)

mikewied
mikewied

Reputation: 5343

If you took you're backup on a non-osx version of Couchbase and are restoring to an osx version then you need to use "-x rehash=1" with cbrestore. The reason is that the osx version of Couchbase is for development only and has less vbuckets then the standard (non-osx) Couchbase versions. The rehash flag tells cbrestore to deal with the different number of vbuckets.

Upvotes: 2

Related Questions