Users backup and restore

Hi , I am taking cbbackup of all the buckets one by one and cbrestore , in another cluster. But I am wondering , How can I backup and restore users/roles.

  • On couchbase 6.0 community

As you have already discovered, cbbackup only backs up the data. If you want to backup the users and groups within Couchbase, you can use the REST API endpoint to access the users and groups to back up, for reference:
https://docs.couchbase.com/server/current/rest-api/rbac.html
For example, to get all users, execute the following:
curl -X GET http://Administrator:adminpwd@127.0.0.1:8091/settings/rbac/users
To get groups:
curl -X GET http://Administrator:adminpwd@127.0.0.1:8091/settings/rbac/groups
note: You will have to manually update the password for each entry in the file you created as the passwords are not recoverable.
Then use a corresponding “PUT” command to restore users and groups, use above link for reference.