Backup Restore Failing
Created by: danielgroves
I'm moving my gilt instance onto a new server, and have not been able to get the backup restoration to work.
The steps I have taken:
- Upgrade GitLab to latest stable on old server
- Install GitLab latest stable on new server, ensuring the same database backend (postgres)
- Run the tests, ensuring all pass
- Run a backup on the old sever
- Copy backup file across to new server via
scp
- Attempt to restore backup
I have confirmed that both servers are running identical versions of git, both have a latest commit reference of 36679b57.
I have run the tests on the new server; all pass:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
Checking Environment ...
Git configured for git user? ... yes
Checking Environment ... Finished
Checking GitLab Shell ...
GitLab Shell version >= 2.2.0 ? ... OK (2.2.0)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
Satellites access is drwxr-x---? ... yes
hooks directories in repos are links: ... can't check, you have no projects
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
/home/git/repositories/: OK
/home/git/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.8.4
Send ping to redis server: PONG
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
projects have namespace: ... can't check, you have no projects
Projects have satellites? ... can't check, you have no projects
Redis version >= 2.0.0? ... yes
Ruby version >= 2.0.0 ? ... yes (2.1.5)
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (1.9.1)
Checking GitLab ... Finished
I used the following to create the backup:
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
I copied them to the new server with:
scp -pr [email protected]:/home/git/gitlab/tmp/backups/ /home/git/gitlab/tmp/backups/
Finally, I restored them using the git user on the new server:
bundle exec rake gitlab:backup:restore
I left this to run, and on return had the following output:
bundle exec rake gitlab:backup:restore RAILS_ENV=production
Unpacking backup ... done
Restoring database ...
Restoring PostgreSQL database gitlabhq_production ... SET
SET
SET
SET
SET
CREATE EXTENSION
psql:/home/git/gitlab/tmp/backups/db/database.sql:22: ERROR: must be owner of extension plpgsql
SET
CREATE SEQUENCE
ALTER TABLE
SET
SET
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
CREATE TABLE
ALTER TABLE
ALTER TABLE
setval
--------
1
(1 row)
setval
--------
23
(1 row)
setval
--------
2
(1 row)
setval
--------
1846
(1 row)
setval
--------
5
(1 row)
setval
--------
200
(1 row)
setval
--------
38
(1 row)
setval
--------
95
(1 row)
setval
--------
43
(1 row)
setval
--------
34
(1 row)
setval
--------
1
(1 row)
setval
--------
1
(1 row)
setval
--------
12
(1 row)
setval
--------
18
(1 row)
setval
--------
177
(1 row)
setval
--------
70
(1 row)
setval
--------
1
(1 row)
setval
--------
113
(1 row)
setval
--------
3
(1 row)
setval
--------
98
(1 row)
setval
--------
36
(1 row)
setval
--------
10
(1 row)
setval
--------
8
(1 row)
setval
--------
56
(1 row)
setval
--------
4
(1 row)
setval
--------
17
(1 row)
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
psql:/home/git/gitlab/tmp/backups/db/database.sql:4782: WARNING: no privileges could be revoked for "public"
REVOKE
psql:/home/git/gitlab/tmp/backups/db/database.sql:4783: WARNING: no privileges could be revoked for "public"
REVOKE
psql:/home/git/gitlab/tmp/backups/db/database.sql:4784: WARNING: no privileges were granted for "public"
GRANT
psql:/home/git/gitlab/tmp/backups/db/database.sql:4785: WARNING: no privileges were granted for "public"
GRANT
[DONE]
done
Restoring repositories ...
danielsgroves/appflow_co_uk ... [DONE]
daniel-groves-design/danielgroves_net ... [DONE]
wsbeorchids/wsbeorchids_org ... [DONE]
* wsbeorchids/wsbeorchids_org.wiki ... [FAILED]
Restore failed
Finally, the output from creating the backup on the old server was as follows:
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
Dumping database ...
Dumping PostgreSQL database gitlabhq_production ... [DONE]
done
Dumping repositories ...
* danielsgroves/appflow_co_uk ... [DONE]
* danielsgroves/appflow_co_uk.wiki ... [SKIPPED]
* daniel-groves-design/danielgroves_net ... [DONE]
* daniel-groves-design/danielgroves_net.wiki ... [SKIPPED]
* wsbeorchids/wsbeorchids_org ... [DONE]
* wsbeorchids/wsbeorchids_org.wiki ... [DONE]
* daniel-groves-design/playground_danielgroves_net ... [DONE]
* daniel-groves-design/playground_danielgroves_net.wiki ... [SKIPPED]
* wsbeorchids/wsbeorchids_webcams ... [DONE]
* wsbeorchids/wsbeorchids_webcams.wiki ... [SKIPPED]
* university/soft225 ... [DONE]
* university/soft225.wiki ... [SKIPPED]
* daniel-groves-design/home ... [SKIPPED]
* daniel-groves-design/home.wiki ... [SKIPPED]
* danielsgroves/catering-system ... [DONE]
* danielsgroves/catering-system.wiki ... [SKIPPED]
* university/comp216 ... [DONE]
* university/comp216.wiki ... [DONE]
* server-observer/placeholder ... [DONE]
* server-observer/placeholder.wiki ... [SKIPPED]
* examples/wordpress-bcrypt ... [DONE]
* examples/wordpress-bcrypt.wiki ... [SKIPPED]
* writhlington-prospect-theatre/wordpress-theme ... [DONE]
* writhlington-prospect-theatre/wordpress-theme.wiki ... [SKIPPED]
* soft335/assignment-one ... [DONE]
* soft335/assignment-one.wiki ... [SKIPPED]
* soft335/practical-week-1 ... [DONE]
* soft335/practical-week-1.wiki ... [SKIPPED]
* soft335/assignment-two ... [DONE]
* soft335/assignment-two.wiki ... [SKIPPED]
* danielsgroves/bykit ... [DONE]
* danielsgroves/bykit.wiki ... [SKIPPED]
* soft335/assignment-three ... [DONE]
* soft335/assignment-three.wiki ... [SKIPPED]
* soft335/assignment-four ... [DONE]
* soft335/assignment-four.wiki ... [SKIPPED]
* soft335/weather ... [DONE]
* soft335/weather.wiki ... [SKIPPED]
* university/soft331 ... [SKIPPED]
* university/soft331.wiki ... [SKIPPED]
* server-observer/development-environment ... [DONE]
* server-observer/development-environment.wiki ... [SKIPPED]
* server-observer/server ... [DONE]
* server-observer/server.wiki ... [SKIPPED]
* server-observer/client-service ... [DONE]
* server-observer/client-service.wiki ... [SKIPPED]
* server-observer/ansible ... [DONE]
* server-observer/ansible.wiki ... [SKIPPED]
* server-observer/gitlab-ci-runner-ansible ... [DONE]
* server-observer/gitlab-ci-runner-ansible.wiki ... [SKIPPED]
* danielsgroves/payload ... [DONE]
* danielsgroves/payload.wiki ... [SKIPPED]
* university/soft338 ... [DONE]
* university/soft338.wiki ... [SKIPPED]
* dashboard-project/main-system ... [DONE]
* dashboard-project/main-system.wiki ... [DONE]
* daniel-groves-design/ci-server-base ... [DONE]
* daniel-groves-design/ci-server-base.wiki ... [SKIPPED]
* daniel-groves-design/jekyll-build-server ... [DONE]
* daniel-groves-design/jekyll-build-server.wiki ... [SKIPPED]
* daniel-groves-design/django-build-sever ... [DONE]
* daniel-groves-design/django-build-sever.wiki ... [SKIPPED]
* daniel-groves-design/ci-server ... [DONE]
* daniel-groves-design/ci-server.wiki ... [SKIPPED]
* daniel-groves-design/irc-bot ... [DONE]
* daniel-groves-design/irc-bot.wiki ... [SKIPPED]
* daniel-groves-design/dotfiles ... [DONE]
* daniel-groves-design/dotfiles.wiki ... [SKIPPED]
done
Dumping uploads ...
done
Creating backup archive: 1417030907_gitlab_backup.tar ... done
Uploading backup archive to remote storage ... skipped
Deleting tmp directories ... done
Deleting old backups ... done. (0 removed)
I'm not too sure how to proceed from here, from reading #3643 (closed) this should work?