Skip to content

Instantly share code, notes, and snippets.

@andrewsomething

andrewsomething/BACKUP.md

Last active Dec 21, 2018
Embed
What would you like to do?
Backup GitLab to DigitalOcean Spaces

Backup GitLab to DigitalOcean Spaces

GitLab uses Fog to communicate with various object storage services when running backups. Fog works with S3 as well as S3-compatible services like Spaces. The key difference is that you need to explictly set the endpoint for non-S3 services. If you are using the "ominbus" GitLab packages, you would need to add the following to /etc/gitlab/gitlab.rb:

gitlab_rails['backup_upload_connection'] = {
  'provider'              => 'AWS',
  'region'                => 'nyc3',
  'aws_access_key_id'     => 'YOUR_SPACES_KEYY',
  'aws_secret_access_key' => 'YOUR_SPACES_SECRET',
  'endpoint'              => 'https://nyc3.digitaloceanspaces.com'
}
gitlab_rails['backup_upload_remote_directory'] = 'name-of-my-space'

After making that addition, GitLab must be reconfigured for the change to take effect:

gitlab-ctl reconfigure

Finally, you can run a backup with:

gitlab-rake gitlab:backup:create

See the full GitLab "Uploading backups to a remote (cloud) storage" docs for more info.

@MayMeow

This comment has been minimized.

Copy link

@MayMeow MayMeow commented Dec 16, 2017

im getting error 403 everytime i try to backup

@andrewsomething

This comment has been minimized.

Copy link
Owner Author

@andrewsomething andrewsomething commented Dec 17, 2017

Do you have the full error message? A 403 could mean a number of things, but the first thing I'd double check is that the credentials are correct.

@JohnnyCosta

This comment has been minimized.

Copy link

@JohnnyCosta JohnnyCosta commented Dec 21, 2017

I am getting error code: 411 Length Required
Any idea?

@williamboman

This comment has been minimized.

Copy link

@williamboman williamboman commented Jan 19, 2018

I'm also getting 403s. On gitlab/gitlab-ce:latest (as of writing). Error code according to response body is SignatureDoesNotMatch. I've tried regenerating Spaces access keys @ DigitalOcean, still no luck.

@JohnnyCosta

This comment has been minimized.

Copy link

@JohnnyCosta JohnnyCosta commented Feb 9, 2018

Try to include 'aws_signature_version' => 2, it may fix it. In my case, I got more exceptions.
I have a ticket open at:
https://gitlab.com/gitlab-org/gitlab-ee/issues/4419

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.