使用gitlab-omnibus设置新服务器(Ubuntu 14.04),我想导入旧的gitlab-data。我按照readme中的说明将旧安装升级到7.10.1以匹配新安装。
将备份复制到正确的位置后,停止unicorn和sidekiq,将备份文件的所有者设置为新服务器上的git
并运行sudo gitlab-rake gitlab:backup:restore BACKUP=XXXXXX
,我得到了
** 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
我仍然不确定这是服务器的错误还是配置错误。也许你可以帮助我,了解最新情况。
database.sql
似乎没问题。
gitlab:check
只会遇到同样的错误。
答案 0 :(得分:1)
一段时间后答案很明显。我只是试图将MySQL-Backup恢复到PostgreSQL数据库,这不是一个好主意。将MySQL-转换为PostgreSQL-Style SQL应该可以解决问题。