tmegos blog

Web developer

GitLabのリストア手順について

手順

基本的には以下の公式サイトの手順通りに行えばリストアできます。

docs.gitlab.com

注意点

BACKUPオプションはバックアップファイルの日付の部分のみを指定する。

BACKUP=timestamp_of_backup (required if more than one backup exists)

例えば以下のようにファイル名を指定すると、語尾に_gitlab_backup.tarがつけられ、ファイルが見つからない旨のエラーが発生します。

# gitlab-rake gitlab:backup:restore BACKUP=1487786527_2017_02_23_gitlab_backup.tar
The backup file 1487786527_2017_02_23_gitlab_backup.tar_gitlab_backup.tar does not exist!

正しいコマンドは以下の通り。

# gitlab-rake gitlab:backup:restore BACKUP=1487786527_2017_02_23 #日付のみ指定

パスを指定する場合も_gitlab_backup.tarは不要。
/mnt/backup/1487786527_2017_02_23_gitlab_backup.tarにファイルがあるとすれば以下のように指定する。

# gitlab-rake gitlab:backup:restore BACKUP=/mnt/backup/1487786527_2017_02_23