Couchbase Technologies

Couchbase – Refresh Views Only

Step 1: Create Archive directory and repository:(allowing views only)-Source side

Syntax : /opt/couchbase/bin/cbbackupmgr config --archive path--repo repoName --include-buckets bucket_name --disable-data --disable-gsi-indexes --disable-ft-indexes --disable-bucket-config 

Example: /opt/couchbase/bin/cbbackupmgr config --archive /u01/backup --repo backup --include-buckets beer-sample --disable-data --disable-gsi-indexes --disable-ft-indexes --disable-bucket-config

Step 2: Trigger Backup-Source side

Syntax : /opt/couchbase/bin/cbbackupmgr backup --archive --repo repo_name --include-buckets bucket_name --username Administrator --password 'pa$$word' --disable-data --disable-gsi-indexes --disable-ft-indexes --disable-bucket-config

Example: /opt/couchbase/bin/cbbackupmgr backup --archive /u01/backup --repo backup --include-buckets beer-sample --username Administrator --password '****' --disable-data --disable-gsi-indexes --disable-ft-indexes --disable-bucket-config

Lists the contents of the backup archive:

/opt/couchbase/bin/cbbackupmgr list –archive /u01/backup –repo backup

Step 3: Trigger Restore(Allowing Views Only)-Target side

Backup views on target side, just for safety purpose.

1) Create an archive directory before copying the backup files from the Source
$mkdir /u01/backup

2) Run below command to create repository on Target side(Directory should be empty, assuming source and target are different hosts)

Syntax :

/opt/couchbase/bin/cbbackupmgr config --archive --repo Repo_name --include-buckets Bucket_name --disable-data --disable-gsi-indexes --disable-ft-indexes --disable-bucket-config


/opt/couchbase/bin/cbbackupmgr config --archive /u01/backup --repo backup --include-buckets beer-sample --disable-data --disable-gsi-indexes --disable-ft-indexes --disable-bucket-config

3) Copy /un tar the backup files from the Source Server to Target server.
$ cd /u01/restore
$ tar -xvf backup.tar

4) Fire the actual restore command :

Syntax : /opt/couchbase/bin/cbbackupmgr restore --archive PATH --repo repoName --host couchbase://IP --username Administrator --password 'pa$$word'

Example : /opt/couchbase/bin/cbbackupmgr restore --archive /u01/backup --repo backup --host couchbase:// --username Administrator --password '****'

Output :
(1/1) Restoring backup 2019-06-11T03_47_37.34827429-04_00
(1/1) Restoring backup 2019-06-11T03_47_37.34827429-04_00 0 items / 0B
Copied all data in 4s (Avg. 0B/Sec) 0 items / 0B
beer-sample [ ] 100.00%

Restore completed successfully

Go to Couchbase GUI –> Indexes–>Views and click “Publish” the views (from Development Views tab) on all nodes, if application team is unable to access the views (or) facing any issues, after the refresh.

For further help, please check below links :

Couchbase documentation for cbbackupmgr backup :
Couchbase documentation for cbbackupmgr restore:

Comments Rating 0 (0 reviews)

About the author


Add Comment

Click here to post a comment