我使用postgresql数据库创建了一个新的gerrit(版本:2.13.11),然后我成功地将我的旧gerrit(版本:2.13.11)的H2数据迁移到新的gerrit。我还执行了reindex命令。但是当我尝试启动gerrit时,它失败了。 这是error_log中的详细信息:
[2018-05-17 15:19:10,550] [main]警告com.google.gerrit.server.config.GitwebCgiConfig:未安装gitweb(未找到/usr/lib/cgi-bin/gitweb.cgi) [2018-05-17 15:19:10,740] [main] INFO org.eclipse.jetty.util.log:记录初始化@ 5032ms [2018-05-17 15:19:10,783] [主要] INFO com.google.gerrit.server.git.LocalDiskRepositoryManager:将core.streamFileThreshold默认为438m [2018-05-17 15:19:10,797] [主要]错误com.google.gerrit.pgm.Daemon:无法启动守护进程 com.google.inject.ProvisionException:无法配置,请参阅以下错误:
1)不支持的架构版本161;预期的架构版本129.不支持降级。
1错误 在com.google.gerrit.server.schema.SchemaVersionCheck.start(SchemaVersionCheck.java:68) 在com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:89) 在com.google.gerrit.pgm.Daemon.start(Daemon.java:313) 在com.google.gerrit.pgm.Daemon.run(Daemon.java:214) 在com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:64) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) 在com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:163) 在com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:104) 在com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:59) 在Main.main(Main.java:25)
这两个gerrit服务器都在jre7中运行。我不知道该怎么办。 请给我一些建议吗?非常感谢你!
答案 0 :(得分:0)
以下是我从H2数据库导出数据的命令:
CALL CSVWRITE('/home/sarah/migrate213/ACCOUNTS', 'SELECT * FROM ACCOUNTS');
CALL CSVWRITE('/home/sarah/migrate213/ACCOUNT_EXTERNAL_IDS', 'SELECT * FROM ACCOUNT_EXTERNAL_IDS');
CALL CSVWRITE('/home/sarah/migrate213/ACCOUNT_GROUPS', 'SELECT * FROM ACCOUNT_GROUPS');
CALL CSVWRITE('/home/sarah/migrate213/ACCOUNT_GROUP_BY_ID', 'SELECT * FROM ACCOUNT_GROUP_BY_ID');
CALL CSVWRITE('/home/sarah/migrate213/ACCOUNT_GROUP_BY_ID_AUD', 'SELECT * FROM ACCOUNT_GROUP_BY_ID_AUD');
CALL CSVWRITE('/home/sarah/migrate213/ACCOUNT_GROUP_MEMBERS', 'SELECT * FROM ACCOUNT_GROUP_MEMBERS');
CALL CSVWRITE('/home/sarah/migrate213/ACCOUNT_GROUP_MEMBERS_AUDIT', 'SELECT * FROM ACCOUNT_GROUP_MEMBERS_AUDIT');
CALL CSVWRITE('/home/sarah/migrate213/ACCOUNT_GROUP_NAMES', 'SELECT * FROM ACCOUNT_GROUP_NAMES');
CALL CSVWRITE('/home/sarah/migrate213/ACCOUNT_PROJECT_WATCHES', 'SELECT * FROM ACCOUNT_PROJECT_WATCHES');
CALL CSVWRITE('/home/sarah/migrate213/CHANGES', 'SELECT * FROM CHANGES');
CALL CSVWRITE('/home/sarah/migrate213/CHANGE_MESSAGES', 'SELECT * FROM CHANGE_MESSAGES');
CALL CSVWRITE('/home/sarah/migrate213/PATCH_COMMENTS', 'SELECT * FROM PATCH_COMMENTS');
CALL CSVWRITE('/home/sarah/migrate213/PATCH_SETS', 'SELECT * FROM PATCH_SETS');
CALL CSVWRITE('/home/sarah/migrate213/PATCH_SET_APPROVALS', 'SELECT * FROM PATCH_SET_APPROVALS');
CALL CSVWRITE('/home/sarah/migrate213/SCHEMA_VERSION', 'SELECT * FROM SCHEMA_VERSION');
CALL CSVWRITE('/home/sarah/migrate213/SYSTEM_CONFIG', 'SELECT * FROM SYSTEM_CONFIG');
SELECT currval('change_message_id');
SELECT currval('change_id');
SELECT currval('account_id');
SELECT currval('account_group_id');
这是我的命令,将旧gerrit的上述数据导入到新的gerrit的PostgreSQL数据库中:
DELETE FROM ACCOUNTS;
COPY ACCOUNTS(registered_on,full_name,preferred_email,inactive,account_id) FROM '/home/sarah/migrate213/ACCOUNTS' DELIMITER ',' CSV HEADER;
DELETE FROM ACCOUNT_EXTERNAL_IDS;
COPY ACCOUNT_EXTERNAL_IDS(account_id,email_address,password,external_id) FROM '/home/sarah/migrate213/ACCOUNT_EXTERNAL_IDS' DELIMITER ',' CSV HEADER;
DELETE FROM ACCOUNT_GROUPS;
COPY ACCOUNT_GROUPS(name,description,visible_to_all,group_uuid,owner_group_uuid,group_id) FROM '/home/sarah/migrate213/ACCOUNT_GROUPS' DELIMITER ',' CSV HEADER;
DELETE FROM ACCOUNT_GROUP_BY_ID;
COPY ACCOUNT_GROUP_BY_ID(group_id,include_uuid) FROM '/home/sarah/migrate213/ACCOUNT_GROUP_BY_ID' DELIMITER ',' CSV HEADER;
DELETE FROM ACCOUNT_GROUP_BY_ID_AUD;
COPY ACCOUNT_GROUP_BY_ID_AUD(added_by,removed_by,removed_on,group_id,include_uuid,added_on) FROM '/home/sarah/migrate213/ACCOUNT_GROUP_BY_ID_AUD' DELIMITER ',' CSV HEADER;
DELETE FROM ACCOUNT_GROUP_MEMBERS;
COPY ACCOUNT_GROUP_MEMBERS(account_id,group_id) FROM '/home/sarah/migrate213/ACCOUNT_GROUP_MEMBERS' DELIMITER ',' CSV HEADER;
DELETE FROM ACCOUNT_GROUP_MEMBERS_AUDIT;
COPY ACCOUNT_GROUP_MEMBERS_AUDIT(added_by,removed_by,removed_on,account_id,group_id,added_on) FROM '/home/sarah/migrate213/ACCOUNT_GROUP_MEMBERS_AUDIT' DELIMITER ',' CSV HEADER;
DELETE FROM ACCOUNT_GROUP_NAMES;
COPY ACCOUNT_GROUP_NAMES(group_id,name) FROM '/home/sarah/migrate213/ACCOUNT_GROUP_NAMES' DELIMITER ',' CSV HEADER;
DELETE FROM ACCOUNT_PROJECT_WATCHES;
COPY ACCOUNT_PROJECT_WATCHES(notify_new_changes,notify_all_comments,notify_submitted_changes,notify_new_patch_sets,notify_abandoned_changes,account_id,project_name,filter) FROM '/home/sarah/migrate213/ACCOUNT_PROJECT_WATCHES' DELIMITER ',' CSV HEADER;
DELETE FROM CHANGES;
COPY CHANGES(change_key,created_on,last_updated_on,owner_account_id,dest_project_name,dest_branch_name,status,current_patch_set_id,subject,topic,row_version,change_id,original_subject,submission_id,note_db_state) FROM '/home/sarah/migrate213/CHANGES' DELIMITER ',' CSV HEADER;
DELETE FROM CHANGE_MESSAGES;
COPY CHANGE_MESSAGES(author_id,written_on,message,patchset_change_id,patchset_patch_set_id,change_id,uuid,tag) FROM '/home/sarah/migrate213/CHANGE_MESSAGES' DELIMITER ',' CSV HEADER;
DELETE FROM PATCH_COMMENTS;
COPY PATCH_COMMENTS(line_nbr,author_id,written_on,status,side,message,parent_uuid,range_start_line,range_start_character,range_end_line,range_end_character,change_id,patch_set_id,file_name,uuid,tag) FROM '/home/sarah/migrate213/PATCH_COMMENTS' DELIMITER ',' CSV HEADER;
DELETE FROM PATCH_SETS;
COPY PATCH_SETS(revision,uploader_account_id,created_on,draft,change_id,patch_set_id,groups,push_certificate) FROM '/home/sarah/migrate213/PATCH_SETS' DELIMITER ',' CSV HEADER;
DELETE FROM PATCH_SET_APPROVALS;
COPY PATCH_SET_APPROVALS(value,granted,change_id,patch_set_id,account_id,category_id,tag) FROM '/home/sarah/migrate213/PATCH_SET_APPROVALS' DELIMITER ',' CSV HEADER;
DELETE FROM SCHEMA_VERSION;
COPY SCHEMA_VERSION(version_nbr,singleton) FROM '/home/sarah/migrate215/SCHEMA_VERSION' DELIMITER ',' CSV HEADER;
DELETE FROM SYSTEM_CONFIG;
COPY SYSTEM_CONFIG(register_email_private_key,site_path,admin_group_id,anonymous_group_id,registered_group_id,wild_project_name,batch_users_group_id,owner_group_id,admin_group_uuid,batch_users_group_uuid,singleton) FROM '/home/sarah/migrate213/SYSTEM_CONFIG' DELIMITER ',' CSV HEADER;
SELECT setval('change_message_id', 1);
SELECT setval('change_id', 2);
SELECT setval('account_id', 1000001);
SELECT setval('account_group_id', 2);
我还将旧gerrit的git目录复制到了新的gerrit。 我成功地重新索引了。
但是当我执行这个命令时它失败了:bin / gerrit.sh start