Redmine(四)——redmine升级

眉间皱痕 提交于 2021-02-12 10:01:21

<h2 style="-webkit-print-color-adjust: exact; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #cccccc; font-family: Helvetica, arial, sans-serif; margin-top: 0px !important;">redmine(四)—— redmine升级</h2> <h2 style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #cccccc; font-family: Helvetica, arial, sans-serif;">Step 1 - 检查需求</h2> <blockquote style="-webkit-print-color-adjust: exact; margin: 15px 0px; border-left-color: #dddddd; padding: 0px 15px; color: #777777; font-family: Helvetica, arial, sans-serif; font-size: 14px; line-height: 22px;"> <p style="-webkit-print-color-adjust: exact; margin: 0px;">按照官方文档,首先就是检查需求</p> </blockquote> <h2 style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #cccccc; font-family: Helvetica, arial, sans-serif;">Step 2 - 备份</h2> <blockquote style="-webkit-print-color-adjust: exact; margin: 15px 0px; border-left-color: #dddddd; padding: 0px 15px; color: #777777; font-family: Helvetica, arial, sans-serif; font-size: 14px; line-height: 22px;"> <p style="-webkit-print-color-adjust: exact; margin: 0px;">备份最小的情况应该包括库的备份和附件的备份等,当然如果还要考虑插件,主题等需要备份的就更多了</p> </blockquote> <pre style="-webkit-print-color-adjust: exact; margin: 15px 0px; background-color: #f8f8f8; border: 1px solid #cccccc; font-size: 13px; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"># Database <br />/usr/bin/mysqldump -u &lt;username&gt; -p&lt;password&gt; &lt;redmine_database&gt; | gzip &gt; /path/to/backup/db/redmine_`date +%y_%m_%d`.gz <br /><br /># Attachments rsync -a /path/to/redmine/files /path/to/backup/files <br />#其余的备份视自己随意了 </code></pre> <h2 style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #cccccc; font-family: Helvetica, arial, sans-serif;">Step 3 - 升级新版本</h2> <blockquote style="-webkit-print-color-adjust: exact; margin: 15px 0px; border-left-color: #dddddd; padding: 0px 15px; color: #777777; font-family: Helvetica, arial, sans-serif; font-size: 14px; line-height: 22px;"> <p style="-webkit-print-color-adjust: exact; margin: 0px;">有两种升级方案,一种是直接通过下载压缩包更新,另一种就是通过源代码更新</p> </blockquote> <h4 style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 16px; font-family: Helvetica, arial, sans-serif;">- 获取tar包或者是zip包</h4> <p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; line-height: 22px;">1、 解压缩文件夹到一个新目录</p> <p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; line-height: 22px;">2、 拷贝相应的配置文件</p> <pre style="-webkit-print-color-adjust: exact; margin: 15px 0px; background-color: #f8f8f8; border: 1px solid #cccccc; font-size: 13px; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">cp old_redmine/config/setting-file new_redmine/config/ <br />cp old_redmine/config/configuration.yml new_redmine/config/ </code></pre> <p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; line-height: 22px;">3、 拷贝备份的文件</p> <pre style="-webkit-print-color-adjust: exact; margin: 15px 0px; background-color: #f8f8f8; border: 1px solid #cccccc; font-size: 13px; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">cp old_redmine/files/* new_redmine/files/ </code></pre> <p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; line-height: 22px;">4、(可选)如果有必要,可以拷贝第三方插件等,但是这里如果是需要涉及数据库操作的插件,单纯的拷贝是无法完成的,另外插件依赖的redmine版本也是有规定的,所以不放建议重新找新版本针对的插件版本</p> <p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; line-height: 22px;">5、 安装需要的gems:</p> <pre style="-webkit-print-color-adjust: exact; margin: 15px 0px; background-color: #f8f8f8; border: 1px solid #cccccc; font-size: 13px; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">bundle install --without development test <br />\\如果提示你 ImageMagick没安装, 可以跳过这个安装或者直接用yum安装,之前的安装篇里已经提到了 </code></pre> <p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; line-height: 22px;">6、 生成会话加密密钥</p> <pre style="-webkit-print-color-adjust: exact; margin: 15px 0px; background-color: #f8f8f8; border: 1px solid #cccccc; font-size: 13px; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">rake generate_secret_token <br />\\这条命令将会创建config/initializers/secret_token.rb </code></pre> <p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; line-height: 22px;">7、 theme目录如果觉得有必要也可以进行备份</p> <h4 style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 16px; font-family: Helvetica, arial, sans-serif;">- svn升级</h4> <p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; line-height: 22px;">1、升级源代码</p> <pre style="-webkit-print-color-adjust: exact; margin: 15px 0px; background-color: #f8f8f8; border: 1px solid #cccccc; font-size: 13px; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">cd old_redmine/ svn update </code></pre> <p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; line-height: 22px;">2、升级gems</p> <pre style="-webkit-print-color-adjust: exact; margin: 15px 0px; background-color: #f8f8f8; border: 1px solid #cccccc; font-size: 13px; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">bundle update </code></pre> <h2 style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #cccccc; font-family: Helvetica, arial, sans-serif;">Step 4 - 升级数据库</h2> <pre style="-webkit-print-color-adjust: exact; margin: 15px 0px; background-color: #f8f8f8; border: 1px solid #cccccc; font-size: 13px; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">rake db:migrate RAILS_ENV=production <br /><br />#如果安装有插件,那么插件也得重新初始化一次 <br />rake redmine:plugins:migrate RAILS_ENV=production </code></pre> <h2 style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #cccccc; font-family: Helvetica, arial, sans-serif;">Step 5 - 清理工作</h2> <p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; line-height: 22px;">1、清理缓存和已经存在的会话</p> <pre style="-webkit-print-color-adjust: exact; margin: 15px 0px; background-color: #f8f8f8; border: 1px solid #cccccc; font-size: 13px; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">rake tmp:cache:clear rake tmp:sessions:clear </code></pre> <p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; line-height: 22px;">2、重启redmine,重启方式见上一篇文章</p> <p style="-webkit-print-color-adjust: exact; margin-top: 15px; margin-right: 0px; margin-left: 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; line-height: 22px; margin-bottom: 0px !important;">3、如果有必要,检查下权限等相关方面来验证是否升级成功</p> <h2 style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #cccccc; font-family: Helvetica, arial, sans-serif;"> </h2>

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!