Question

How to backup CockroachDB to Spaces?

Posted March 19, 2021 198 views
DigitalOcean Spaces

I’m running CockroachDB on a DO droplet and want to backup the database to Spaces.

I’ve tried numerous variations on the backup command along the lines of:

backup into 's3://backups?AWS_ACCESS_KEY_ID=xxx&AWS_SECRET_ACCESS_KEY=xxx&AWS_ENDPOINT=fra1.digitaloceanspaces.com';

I’m struggling to find the correct form for the destination string. A working example would be most helpful.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Found on:
github

I found that these four vars all needed to be set:

AWS_ENDPOINT
AWS_REGION
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY

Example:

BACKUP INTO 's3://{bucket}/{path}?AWS_ENDPOINT=sfo2.digitaloceanspaces.com&AWS_REGION=sfo2&AWS_ACCESS_KEY_ID={xxx}&AWS_SECRET_ACCESS_KEY={xxx}';

Cheers.