For HR Assistant, we use Cloudant database as storage of the data on the IBM Cloud
Today I was thinking about ‘what if we loose our data as something goes wrong’. It is not likeable, but still possible.
Make a backup
On IBM Cloud, there is documentation about making a backup of your data.
So installed the npm package couchbackup and run the command as described in the documentation.]
I changed only to store the output as a JSON file.
When I run the command I hit an error about authentication
Set permissions
I move over to my Cloudant database and opened the permissions page. On that page I selected, temporarily, the _reader checkbox for the Unauthenticated connections.
Moved back to Terminal and return the backup command, this time it ran successful.
After inspecting the backup JSON file, I was really happy with the result.
A very important note this method while beyond handy(thanks for tip!) it DOES NOT backup any documents with attachments in them.
I checked my backup file and I can confirm it does backup my attachment, which is a base64 encoded string in the document