0

Setting up a new server (Ubuntu 14.04) with gitlab-omnibus, I want to import my old gitlab-data. I followed the instructions in the readme and upgraded my old installation to 7.10.1 to match the new one.

After copying the backup to the correct location, stopping unicorn and sidekiq, setting owner of the backup file to git on the new server and running sudo gitlab-rake gitlab:backup:restore BACKUP=XXXXXX, I get

** Invoke gitlab:backup:restore (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute gitlab:backup:restore
Unpacking backup ... done
** Invoke gitlab:backup:db:restore (first_time)
** Invoke environment
** Execute gitlab:backup:db:restore
Restoring database ...
Restoring PostgreSQL database gitlabhq_production ... ** Invoke gitlab:db:drop_all_tables (first_time)
** Invoke environment
** Execute gitlab:db:drop_all_tables
** Invoke gitlab:db:drop_all_postgres_sequences (first_time)
** Invoke environment
** Execute gitlab:db:drop_all_postgres_sequences
psql:/var/opt/gitlab/backups/db/database.sql:22: ERROR:  syntax error at or near "`"
LINE 1: DROP TABLE IF EXISTS `application_settings`;
                             ^

...


psql:/var/opt/gitlab/backups/db/database.sql:172: invalid command \'
psql:/var/opt/gitlab/backups/db/database.sql:1135: ERROR:  syntax error at or near "`"
LINE 1: INSERT INTO `events` VALUES (17,NULL,NULL,NULL,NULL,5,'2014-...
                    ^
[DONE]
done
** Invoke gitlab:backup:repo:restore (first_time)
** Invoke environment
** Execute gitlab:backup:repo:restore
Restoring repositories ...
rake aborted!
ActiveRecord::StatementInvalid: PG::Error: ERROR:  relation "projects" does not exist
LINE 1: SELECT  "projects".* FROM "projects"   ORDER BY "projects"."...
                                  ^
: SELECT  "projects".* FROM "projects"   ORDER BY "projects"."id" ASC LIMIT 1000
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `exec'

...

/opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/rake:23:in `load'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/rake:23:in `<main>'
PG::Error: ERROR:  relation "projects" does not exist
LINE 1: SELECT  "projects".* FROM "projects"   ORDER BY "projects"."...
                                  ^
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `exec'

...

/opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/rake:23:in `<main>'
Tasks: TOP => gitlab:backup:repo:restore

I'm still not sure whether this is a bug or a misconfiguration of the server. Maybe you could help me, understanding whats going on.

The database.sql seems to be fine. The gitlab:check only runs into the same error.

1 Answer 1

1

The Answer is quite obvious after some time. I just tried to restore a MySQL-Backup into a PostgreSQL database, wich is no good idea. Translating MySQL- into PostgreSQL-Style SQL should do the trick.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.