2015-05-07 21 views
0

使用gitlab-omnibus設置一個新的服務器(Ubuntu 14.04),我想導入我舊的gitlab數據。我按照readme中的說明操作,並將舊版本升級到7.10.1以匹配新版本。gitlab備份恢復中止與錯誤「關係未找到」

備份複製到正確的位置,停止麒麟和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只會出現相同的錯誤。

回答

1

答案在一段時間後相當明顯。我只是試圖將MySQL-Backup恢復到PostgreSQL數據庫,這不是個好主意。將MySQL轉換爲PostgreSQL風格的SQL應該能夠做到這一點。