Verified in 5.5.4-4321:
[root@node1-mad-hatter-testing-centos7 ~]# /opt/couchbase/bin/cbrestore ~/backup1 http://127.0.0.1:8091 -x design_doc_only=1 -b beer-sample -u Administrator -p password -vvv
2019-02-28 03:25:58,710: mt cbrestore...
2019-02-28 03:25:58,711: mt source : /root/backup1
2019-02-28 03:25:58,711: mt sink : http://127.0.0.1:8091
2019-02-28 03:25:58,711: mt opts : {'username': '<xxx>', 'verbose': 3, 'extra':
{'max_retry': 10.0, 'rehash': 0.0, 'dcp_consumer_queue_length': 1000.0, 'data_only': 0.0, 'uncompress': 0.0, 'nmv_retry': 1.0, 'conflict_resolve': 1.0, 'cbb_max_mb': 100000.0, 'report': 5.0, 'mcd_compatible': 1.0, 'try_xwm': 1.0, 'backoff_cap': 10.0, 'batch_max_bytes': 400000.0, 'report_full': 2000.0, 'flow_control': 1.0, 'batch_max_size': 1000.0, 'seqno': 0.0, 'design_doc_only': 1.0, 'allow_recovery_vb_remap': 0.0, 'recv_min_bytes': 4096.0}
, 'collection': None, 'ssl': False, 'threads': 4, 'to_date': None, 'key': None, 'password': '<xxx>', 'id': None, 'bucket_source': 'beer-sample', 'silent': False, 'dry_run': False, 'from_date': None, 'bucket_destination': None, 'add': False, 'vbucket_list': None, 'separator': '::'}
2019-02-28 03:25:58,711: mt source_class: <class 'pump_bfd.BFDSource'>
2019-02-28 03:25:58,711: mt sink_class: <class 'pump_cb.CBSink'>
2019-02-28 03:25:58,723: mt Starting new HTTP connection (1): 127.0.0.1
2019-02-28 03:25:58,727: mt "GET /pools/default/buckets HTTP/1.1" 200 10065
2019-02-28 03:25:58,734: mt source_bucket: beer-sample
2019-02-28 03:25:58,734: mt sink_bucket: beer-sample
2019-02-28 03:25:58,734: mt source_buckets: beer-sample
2019-02-28 03:25:58,734: mt bucket_source: beer-sample
2019-02-28 03:25:58,734: mt source_buckets filtered: beer-sample
2019-02-28 03:25:58,735: mt bucket: beer-sample
transfer design doc only. bucket msgs will be skipped.
2019-02-28 03:25:58,735: mt design_doc row: {u'controllers':
{u'compact': u'/pools/default/buckets/beer-sample/ddocs/_design%2Fbeer/controller/compactView', u'setUpdateMinChanges': u'/pools/default/buckets/beer-sample/ddocs/_design%2Fbeer/controller/setUpdateMinChanges'}
, u'doc': {u'json': {u'_id': u'_design/beer', u'language': u'javascript', u'views': {u'brewery_beers': {u'map': u'function(doc, meta) {\n switch(doc.type) {\n case "brewery":\n emit([meta.id]);\n break;\n case "beer":\n if (doc.brewery_id)
{\n emit([doc.brewery_id, meta.id]);\n }\n break;\n }\n}\n'}, u'by_location': {u'map': u'function (doc, meta) {\n if (doc.country, doc.state, doc.city) {\n emit([doc.country, doc.state, doc.city], 1);\n } else if (doc.country, doc.state) {\n emit([doc.country, doc.state], 1);\n } else if (doc.country) {\n emit([doc.country], 1);\n }\n}', u'reduce': u'_count'}}}, u'meta': {u'rev': u'1-bd8521cf', u'id': u'_design/beer'}}}
2019-02-28 03:25:58,735: mt design_doc: {"_id": "_design/beer", "language": "javascript", "views": {"brewery_beers": {"map": "function(doc, meta) {\n switch(doc.type) {\n case \"brewery\":\n emit(
[meta.id]);\n break;\n case \"beer\":\n if (doc.brewery_id) {n emit([doc.brewery_id, meta.id]);n }
\n break;\n }\n}\n"}, "by_location": {"map": "function (doc, meta) {\n if (doc.country, doc.state, doc.city)
{\n emit([doc.country, doc.state, doc.city], 1);\n }
else if (doc.country, doc.state)
{\n emit([doc.country, doc.state], 1);\n }
else if (doc.country)
{\n emit([doc.country], 1);\n }
\n}", "reduce": "_count"}}}
2019-02-28 03:25:58,735: mt design_doc id: _design/beer at: /beer-sample%2B5407dd72f4e8f9aa1f16aa8fd422356c/_design/beer
2019-02-28 03:25:58,735: mt rest_request: <ud>Administrator</ud>@127.0.0.1:8092/beer-sample%2B5407dd72f4e8f9aa1f16aa8fd422356c/_design/beer; reason: consume_design
2019-02-28 03:25:58,782: mt design_doc created at: /beer-sample%2B5407dd72f4e8f9aa1f16aa8fd422356c/_design/beer
2019-02-28 03:25:58,783: mt Starting new HTTP connection (1): 127.0.0.1
2019-02-28 03:25:58,785: mt "GET /pools/default/nodeServices HTTP/1.1" 200 363
2019-02-28 03:25:58,786: mt Starting new HTTP connection (1): 127.0.0.1
2019-02-28 03:25:58,879: mt "POST /restoreIndexMetadata?bucket=beer-sample HTTP/1.1" 200 18
done
This bug was introduce in 5.5.0. It's related to how design docs are transferred depending on the bucket type. Unfortunately not all sources, in this case backup does have a bucket types.