Skip to content
Snippets Groups Projects
Select Git revision
20 results

backup_restore.md

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    backup_restore.md 7.91 KiB

    Backup restore

    backup banner

    Create a backup of the GitLab system

    A backup creates an archive file that contains the database, all repositories and all attachments. This archive will be saved in backup_path (see config/gitlab.yml). The filename will be [TIMESTAMP]_gitlab_backup.tar. This timestamp can be used to restore an specific backup. You can only restore a backup to exactly the same version of GitLab that you created it on, for example 7.2.1.

    # use this command if you've installed GitLab with the Omnibus package
    sudo gitlab-rake gitlab:backup:create
    
    # if you've installed GitLab from source or using the cookbook
    sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production

    Example output:

    Dumping database tables:
    - Dumping table events... [DONE]
    - Dumping table issues... [DONE]
    - Dumping table keys... [DONE]
    - Dumping table merge_requests... [DONE]
    - Dumping table milestones... [DONE]
    - Dumping table namespaces... [DONE]
    - Dumping table notes... [DONE]
    - Dumping table projects... [DONE]
    - Dumping table protected_branches... [DONE]
    - Dumping table schema_migrations... [DONE]
    - Dumping table services... [DONE]
    - Dumping table snippets... [DONE]
    - Dumping table taggings... [DONE]
    - Dumping table tags... [DONE]
    - Dumping table users... [DONE]
    - Dumping table users_projects... [DONE]
    - Dumping table web_hooks... [DONE]
    - Dumping table wikis... [DONE]
    Dumping repositories:
    - Dumping repository abcd... [DONE]
    Creating backup archive: $TIMESTAMP_gitlab_backup.tar [DONE]
    Deleting tmp directories...[DONE]
    Deleting old backups... [SKIPPING]

    Upload backups to remote (cloud) storage

    Starting with GitLab 7.4 you can let the backup script upload the '.tar' file it creates. It uses the Fog library to perform the upload. In the example below we use Amazon S3 for storage. But Fog also lets you use other storage providers.

    For omnibus packages: