Restoring design documents

Restoring design documents

Design documents are restored using the design_doc_only=1 option.


Design documents are restored to a server node with the option, design_doc_only=1 . The documents are restored from a backup file (created with the cbbackup ) tool.


Basic syntax:

cbrestore [backup-location] http://[localhost]:8091 -x design_doc_only=1 -b [source-bucket] -B [destination-bucket]


The following example restores design documents from the backup file, ~/backup/a_bucket, to the destination bucket, my_bucket, in a cluster.

cbrestore ~/backup -x design_doc_only=1 -b a_bucket -B my_bucket
If multiple source buckets were backed up, this command must be performed multiple times. In the following example, a cluster with two data buckets is backed up and has the following backup files:
  • ~/backup/bucket_one/design.json
  • ~/backup/bucket_two/design.jsonT

The following command restores the design documents in both backup files to a bucket in a cluster named my_bucket .

cbrestore ~/backup -x design_doc_only=1 -b bucket_one -B my_bucket

cbrestore ~/backup -x design_doc_only=1 -b bucket_two -B my_bucket


The following example response shows a successful restore.

transfer design doc only. bucket msgs will be skipped.