Skip to content

Instantly share code, notes, and snippets.

@mrrooijen
Created July 22, 2012 21:04
Show Gist options
  • Select an option

  • Save mrrooijen/3161044 to your computer and use it in GitHub Desktop.

Select an option

Save mrrooijen/3161044 to your computer and use it in GitHub Desktop.
Backing up and restoring your GitlabHQ server.

GitLabHQ Backup and Restore procedure

First stop the GitLabHQ server, I'm using Upstart to monitor/manage the processes. It'll be different for you if you're using another process managing tool likt inittab, god or bluepill.

sudo stop gitlab

Next, be sure to remove the sqlite database and all the repositories for it to properly restore back from a backup.

sudo rm /home/gitlab/gitlab/db/production.sqlite3
sudo rm -rf /home/git/repositories/*

Then proceed to restore the backup with the following commands:

cd /home/gitlab/gitlab
sudo -u gitlab rake gitlab:app:backup_restore RAILS_ENV=production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment