{"id":2445,"date":"2014-01-15T11:23:02","date_gmt":"2014-01-15T03:23:02","guid":{"rendered":"http:\/\/blog.pighead.cc\/whsyu\/?p=2445"},"modified":"2014-01-15T11:24:49","modified_gmt":"2014-01-15T03:24:49","slug":"migration-from-mantis-to-redmine","status":"publish","type":"post","link":"https:\/\/blog.pighead.cc\/whsyu\/2014\/01\/15\/migration-from-mantis-to-redmine\/","title":{"rendered":"\u628a Mantis \u7684\u8cc7\u6599\u5012\u9032 Redmine"},"content":{"rendered":"<p class=\"bb-post-separator\"><strong>[\u83ef\u8a9e, cmn-Hant-TW]  <\/strong><\/p><p>\u60f3\u8981\u628a <a href=\"http:\/\/www.mantisbt.org\">mantis<\/a> 1.2.x \u7684\u8cc7\u6599\u5012\u9032 <a href=\"http:\/\/www.redmine.org\">redmine<\/a> 2.4.x \u7684\u6642\u5019\u51fa\u4e86\u9ede\u554f\u984c\uff0c\u5167\u5efa\u7684 <code>.\/lib\/tasks\/migrate_from_mantis.rake<\/code> \u600e\u9ebc\u8a66\u90fd\u5931\u6557\uff0c\u5f8c\u4f86\u767c\u73fe\u6709\u4eba\u7528 perl \u5beb\u4e86\u4e00\u5957\u8f49\u63db\u7cfb\u7d71 <a href=\"https:\/\/github.com\/ukautz\/mantis2redmine\">mantis2redmine<\/a> \u7d66 mysql \u7528\uff0c\u53ea\u8981\u628a\u8cc7\u6599\u5eab\u8a2d\u5b9a\u4e00\u4e0b\uff0c\u7136\u5f8c\u8f38\u5165\u60f3\u8981\u8f49\u63db\u5c0d\u61c9\uff0ccategory, workflow, user \u7b49\uff0c\u7136\u5f8c\u7b49\u4ed6\u8dd1\u5b8c\u5c31\u5012\u9032\u53bb\u4e86\u3002 \u552f\u4e00\u8981\u6ce8\u610f\u7684\u662f\u8a9e\u7cfb\u554f\u984c\uff0c\u5982\u679c utf8 \u7684\u5b57\u8f49\u904e\u53bb\u8b8a\u4e82\u78bc\uff0c\u9664\u4e86\u5169\u908a\u8cc7\u6599\u5eab\u7684\u8a2d\u5b9a\u8981\u5c0d\u5916\uff0c\u5728 mantis2redmine \u88e1\u9762\u547c\u53eb DBD-mysql \u7684\u5730\u65b9 mysql_enable_utf8 \u4e5f\u8981\u7d66\u4ed6\u8a2d\u4e00\u4e0b\uff0c\u5230\u9019\u88e1\u8cc7\u6599\u5eab\u61c9\u8a72\u5c31\u7b97\u662f\u5012\u597d\u4e86\u3002<\/p>\n<p>\u8dd1\u4e00\u4e0b project \u5217\u8868\u6709\u51fa\u4f86\uff0c\u4f46\u662f\u53ea\u8981\u4e00\u958b issues \u9801\u9762\u5c31\u72c2\u5403 500 \u932f\u8aa4\uff0c\u4e3b\u8981\u7684\u932f\u8aa4\u8a0a\u606f\u662f\u9019\u500b\uff1a<br \/>\n<code>Error viewing some issues: ActionView::Template::Error (undefined method `-' for nil:NilClass):<\/code><\/p>\n<p>\u770b\u4e86\u4e00\u4e0b log \u4e5f\u770b\u4e0d\u51fa\u5012\u5e95\u662f\u4ec0\u9ebc\u9020\u6210\u7684\uff0c\u7136\u5f8c\u53ea\u597d\u56de\u53bb\u624b\u52d5\u4e00\u500b\u4e00\u500b\u6aa2\u67e5\u8cc7\u6599\u5eab\u7684\u6b04\u4f4d\uff0c\u767c\u73fe\u53ea\u8981 lft lgt \u503c\u662f NULL \u5c31\u6703\u70b8\u6389\uff0c\u5f8c\u4f86\u770b\u5230<a href=\"http:\/\/www.redmine.org\/issues\/14335\">\u9019\u7bc7<\/a>\u6709\u9047\u5230\u985e\u4f3c\u7684\u60c5\u6cc1\uff0c\u5c31\u7167\u8457\u4e0b\u9019\u500b\u6307\u4ee4<\/p>\n<pre lang=\"none\"># ruby script\/rails runner 'Project.rebuild_tree!'\r\n# ruby script\/rails runner 'Issue.rebuild!'<\/pre>\n<p>\u8dd1\u5b8c\u4e4b\u5f8c\u9801\u9762\u679c\u7136\u5c31\u6062\u5fa9\u6b63\u5e38\u3002<\/p>\n<p>\u518d\u5de1\u4e86\u4e00\u4e0b\uff0c\u6771\u897f\u80fd\u7528\u662f\u80fd\u7528\uff0c\u5927\u90e8\u4efd\u8a72\u904e\u4f86\u7684\u6771\u897f\u90fd\u6709\u904e\u4f86\uff0c\u4f46\u662f\u6709\u4e9b\u5728\u539f\u672c mantis \u4e0b\u5c31\u6c92\u6709\u7684\u6b04\u4f4d\uff0c\u8f49\u63db\u5230 redmine \u4e4b\u5f8c\u4e5f\u53ea\u80fd\u5148\u5957\u9810\u8a2d\u503c\uff0c\u50cf\u662f project \u5efa\u7acb\u6642\u9593\u6216\u662f identifier \u7b49\u3002\u96d6\u7136\u4e0d\u5f71\u97ff\u64cd\u4f5c\u4f46\u770b\u8d77\u4f86\u5be6\u5728\u6709\u9ede\u7919\u773c\uff0c\u6240\u4ee5\u53c8\u82b1\u4e86\u4e9b\u6642\u9593\u624b\u52d5\u6539\u8cc7\u6599\u5eab\u5167\u7684\u6b04\u4f4d\u3002\u642c\u5bb6\u7e3d\u662f\u8981\u6253\u6383\u4e00\u4e0b\u7684\u561b\uff0c\u6253\u6383\u5b8c\u4e4b\u5f8c\u7684 redmine \u770b\u8d77\u4f86\u8212\u670d\u591a\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[\u83ef\u8a9e, cmn-Hant-TW] \u60f3\u8981\u628a mantis 1.2.x \u7684\u8cc7\u6599\u5012\u9032 redmine 2.4.x \u7684\u6642\u5019\u51fa\u4e86\u9ede\u554f\u984c\uff0c\u5167\u5efa\u7684 .\/lib\/tasks\/migrate_from_mantis.rake \u600e\u9ebc\u8a66\u90fd\u5931\u6557\uff0c\u5f8c\u4f86\u767c\u73fe\u6709\u4eba\u7528 perl \u5beb\u4e86\u4e00\u5957\u8f49\u63db\u7cfb\u7d71 mantis2redmine \u7d66 mysql \u7528\uff0c\u53ea\u8981\u628a\u8cc7\u6599\u5eab\u8a2d\u5b9a\u4e00\u4e0b\uff0c\u7136\u5f8c\u8f38\u5165\u60f3\u8981\u8f49\u63db\u5c0d\u61c9\uff0ccategory, workflow, user \u7b49\uff0c\u7136\u5f8c\u7b49\u4ed6\u8dd1\u5b8c\u5c31\u5012\u9032\u53bb\u4e86\u3002 \u552f\u4e00\u8981\u6ce8\u610f\u7684\u662f\u8a9e\u7cfb\u554f\u984c\uff0c\u5982\u679c utf8 \u7684\u5b57\u8f49\u904e\u53bb\u8b8a\u4e82\u78bc\uff0c\u9664\u4e86\u5169\u908a\u8cc7\u6599\u5eab\u7684\u8a2d\u5b9a\u8981\u5c0d\u5916\uff0c\u5728 mantis2redmine \u88e1\u9762\u547c\u53eb DBD-mysql \u7684\u5730\u65b9 mysql_enable_utf8 \u4e5f\u8981\u7d66\u4ed6\u8a2d\u4e00\u4e0b\uff0c\u5230\u9019\u88e1\u8cc7\u6599\u5eab\u61c9\u8a72\u5c31\u7b97\u662f\u5012\u597d\u4e86\u3002 \u8dd1\u4e00\u4e0b project \u5217\u8868\u6709\u51fa\u4f86\uff0c\u4f46\u662f\u53ea\u8981\u4e00\u958b issues \u9801\u9762\u5c31\u72c2\u5403 500 \u932f\u8aa4\uff0c\u4e3b\u8981\u7684\u932f\u8aa4\u8a0a\u606f\u662f\u9019\u500b\uff1a Error viewing some issues:&hellip; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[4577,4580,4578,4579],"class_list":["post-2445","post","type-post","status-publish","format-standard","hentry","category-freebsd","tag-mantis","tag-mysql","tag-redmine","tag-ruby"],"_links":{"self":[{"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/posts\/2445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/comments?post=2445"}],"version-history":[{"count":12,"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/posts\/2445\/revisions"}],"predecessor-version":[{"id":2457,"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/posts\/2445\/revisions\/2457"}],"wp:attachment":[{"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/media?parent=2445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/categories?post=2445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/tags?post=2445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}