Plone技术资料

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1762|回复: 0

从Plone'我要我'到'我爱您'——Plone之5.1.5升级到5.2.0

[复制链接]
发表于 2019-7-30 12:55:00 | 显示全部楼层 |阅读模式
本文纪实从 “Plone'我要我'到'我爱您'——Plone之5.1.5升级到5.2.0”之升级过程。
一、准备工作
1、准备Plone5.1.5stage Server,配置必须和Product Server完全一致(但只启用单个开发实例)
2、准备Plone5.2.0测试环境注意:一定选用Python2.7.x系列来构建5.2.0的virtualenv
二、准备插件(非Plone系统核心包)迁移
1、检测插件兼容性
逐个将自己开发或其他三方开发的插件加载到Plone5.2.0测试环境,运行buildout ,bin/instance fg
2、不兼容插件处理
处理不兼容插件有两种方式:
  • 给插件新建一个名为python3的branch,更改代码,以兼容python2.7.x及python3.7.x,并且能正常在Plone5.2.0安装使用
  • 标记出该不兼容插件,在原Plone5.1.5 stage Server环境中卸载该插件

三、准备stage server新的buildout环境
由于Plone5.1.5和 Plone5.2.0有不同的setuptools及zc.buildout版本要求,所以要更新buildout环境:
1、激活stage server的virtualenv环境
  1. source bin/active
复制代码
检测该virtenv中python ,确保是python2.7.x系列。

2、卸载原5.1.5的requirements
  1. pip uninstall  -r requirements_515.txt
复制代码
3、安装5.2.0的requirements,建立新的buildout环境
  1. pip install -r requirements_520.txt
复制代码
四、卸载不兼容插件(可选,如在二.2中,有要卸载的插件,则执行该步骤)

完全卸载在二.2中查找出来的不兼容插件,注意:程序和相关数据都必须完全清除!

五、更新Plone版本主配置文件
此Plone主版本配置文件和插件配置文件是packages.cfg,注意在四中卸载的插件要拿掉(清除掉)。
1、Plone主版本配置文件部分更新到5.2.0
  1. [buildout]
  2. extensions = mr.developer
  3. show-picked-versions = true
  4. update-versions-file = versionslastprod3.cfg
  5. #overwrite-picked-versions-file = true
  6. extends =
  7. # Known good sets of eggs we may be using
  8. #               http://dist.plone.org/release/5-latest/versions.cfg
  9. #    http://dist.plone.org/release/5.1.5/versions.cfg
  10. #    5.1.1-versions.cfg
  11.     http://dist.plone.org/release/5.2.0/versions.cfg
  12.     pins52.cfg
复制代码
注意上图中最后两行,一个取用5.2.0配置文件,另一个pins52.cfg 为版本调整文件。
2、更新插件配置部分
  1. eggs]
  2. main =
  3.     Plone
  4. #    Products.PloneFormGen
  5. #    Products.ContentWellPortlets
  6. #    my315ok.socialorgnization
  7.     quintagroup.seoptimizer
  8.     my315ok.products
  9.     collective.diazotheme.bootstrap
  10. #    dexterity.membrane
  11. #    xtshzz.policy
  12.     xtcs.policy
  13.     xtcs.theme
  14.     qyxycjh.policy
  15.     qyxycjh.theme
  16.     qidejt.theme
  17.     qidejt.policy
  18.     xsgs.policy
  19.     xsgs.theme
  20.     hjzgb.theme
复制代码
注意上图中#号注释的插件为不兼容的,已拿掉。

六、更新开发实例配置文件

  1. extends =
  2.     packages.cfg

  3. # Development Zope instance. Installs the ``bin/instance`` script
  4. [instance]
  5. recipe = plone.recipe.zope2instance
  6. http-address = 8080
  7. user = admin:admin
  8. debug-mode = on
  9. verbose-security = on
  10. wsgi = off
  11. eggs =
  12.     Zserver
  13. #    plone.app.blob
  14. #    Products.ATContentTypes
  15. #    Products.contentmigration
  16.     ${eggs:main}
  17.     ${eggs:devtools}
  18.     plone.app.robotframework
复制代码
注意:在instance段添加了“wsgi = off”;"eggs = "部分添加了ZServer

七、运行buildout建立开发实例
  1. bin/buildout -Nv -c buildout_dev.cfg
复制代码
解决buildout过程中发现的各种问题。

八、调试模式启动开发实例
1、启动调试
  1. bin/instance fg
复制代码

2、解决调试模式启动中发现的各种问题

九、备份stage server
  1. cp -a Data.fs Data.fs.bk
复制代码

十、启动开发实例,开始升级
1、启动实例
2、在浏览器地址栏中输入http://localhost:8080/,进入ZMI:


在“站点-Plone”,点击“升级……”:

勾选“模拟执行模式”,点击“升级”:

如果模拟升级过程没有问题,则执行下一步的实际升级。否则,退回,查错,处理。

实际的升级过程做了如下事情:
  1. Starting the migration from version: 5112
  2. Role / permission map imported.
  3. Removed record plone.resources/resource-plone-app-event-js.deps.
  4. Removed record plone.resources/resource-plone-app-event-js.url.
  5. Removed record plone.resources/resource-plone-app-event-js.js.
  6. Removed record plone.resources/resource-plone-app-event-js.init.
  7. Removed record plone.resources/resource-plone-app-event-js.export.
  8. Removed record plone.resources/resource-plone-app-event-js.conf.
  9. Removed record plone.resources/resource-plone-app-event-js.css.
  10. Removed record plone.resources/resource-plone-app-event-css.deps.
  11. Removed record plone.resources/resource-plone-app-event-css.url.
  12. Removed record plone.resources/resource-plone-app-event-css.js.
  13. Removed record plone.resources/resource-plone-app-event-css.init.
  14. Removed record plone.resources/resource-plone-app-event-css.export.
  15. Removed record plone.resources/resource-plone-app-event-css.conf.
  16. Removed record plone.resources/resource-plone-app-event-css.css.
  17. Ran upgrade step: Run to513 upgrade profile.
  18. Ran upgrade step: Force remove old p.a.event resources
  19. Role / permission map imported.
  20. Removed record plone.resources/jquery-highlightsearchterms.deps.
  21. Removed record plone.resources/jquery-highlightsearchterms.url.
  22. Removed record plone.resources/jquery-highlightsearchterms.js.
  23. Removed record plone.resources/jquery-highlightsearchterms.init.
  24. Removed record plone.resources/jquery-highlightsearchterms.export.
  25. Removed record plone.resources/jquery-highlightsearchterms.conf.
  26. Removed record plone.resources/jquery-highlightsearchterms.css.
  27. Ran upgrade step: Run to514 upgrade profile.
  28. Ran upgrade step: Miscellaneous
  29. Role / permission map imported.
  30. Ran upgrade step: Run to515 upgrade profile.
  31. Ran upgrade step: Miscellaneous
  32. Role / permission map imported.
  33. Adapters registered.
  34. The object None was not found, while trying to register an utility. The provided object definition was portal_metadata. The site used was: <PloneSite at /Plone>
  35. The object None was not found, while trying to register an utility. The provided object definition was portal_syndication. The site used was: <PloneSite at /Plone>
  36. The object None was not found, while trying to register an utility. The provided object definition was portal_undo. The site used was: <PloneSite at /Plone>
  37. Utilities registered.
  38. Skins tool imported.
  39. Removed record plone.resources/jquery-highlightsearchterms.deps.
  40. Removed record plone.resources/jquery-highlightsearchterms.url.
  41. Removed record plone.resources/jquery-highlightsearchterms.js.
  42. Removed record plone.resources/jquery-highlightsearchterms.init.
  43. Removed record plone.resources/jquery-highlightsearchterms.export.
  44. Removed record plone.resources/jquery-highlightsearchterms.conf.
  45. Removed record plone.resources/jquery-highlightsearchterms.css.
  46. Rebuilding member data information. This step can take a while if your site has many users.
  47. Ran upgrade step: Run to52alpha1 upgrade profile.
  48. Ran upgrade step: Miscellaneous
  49. Role / permission map imported.
  50. Not creating required tool portal_css, because class Products.ResourceRegistries.tools.CSSRegistry.CSSRegistryTool is not found.
  51. Not creating required tool portal_javascripts, because class Products.ResourceRegistries.tools.JSRegistry.JSRegistryTool is not found.
  52. Toolset imported.
  53. Actions tool imported.
  54. Control panel imported.
  55. RepositoryTool settings imported.
  56. Removed record plone.resources/expect.deps.
  57. Removed record plone.resources/expect.url.
  58. Removed record plone.resources/expect.js.
  59. Removed record plone.resources/expect.init.
  60. Removed record plone.resources/expect.export.
  61. Removed record plone.resources/expect.conf.
  62. Removed record plone.resources/expect.css.
  63. Removed record plone.resources/js-shortcuts.deps.
  64. Removed record plone.resources/js-shortcuts.url.
  65. Removed record plone.resources/js-shortcuts.js.
  66. Removed record plone.resources/js-shortcuts.init.
  67. Removed record plone.resources/js-shortcuts.export.
  68. Removed record plone.resources/js-shortcuts.conf.
  69. Removed record plone.resources/js-shortcuts.css.
  70. Removed record plone.resources/marked.deps.
  71. Removed record plone.resources/marked.url.
  72. Removed record plone.resources/marked.js.
  73. Removed record plone.resources/marked.init.
  74. Removed record plone.resources/marked.export.
  75. Removed record plone.resources/marked.conf.
  76. Removed record plone.resources/marked.css.
  77. Removed record plone.resources/rjs.deps.
  78. Removed record plone.resources/rjs.url.
  79. Removed record plone.resources/rjs.js.
  80. Removed record plone.resources/rjs.init.
  81. Removed record plone.resources/rjs.export.
  82. Removed record plone.resources/rjs.conf.
  83. Removed record plone.resources/rjs.css.
  84. Removed record plone.resources/react.deps.
  85. Removed record plone.resources/react.url.
  86. Removed record plone.resources/react.js.
  87. Removed record plone.resources/react.init.
  88. Removed record plone.resources/react.export.
  89. Removed record plone.resources/react.conf.
  90. Removed record plone.resources/react.css.
  91. Removed record plone.resources/JSXTransformer.deps.
  92. Removed record plone.resources/JSXTransformer.url.
  93. Removed record plone.resources/JSXTransformer.js.
  94. Removed record plone.resources/JSXTransformer.init.
  95. Removed record plone.resources/JSXTransformer.export.
  96. Removed record plone.resources/JSXTransformer.conf.
  97. Removed record plone.resources/JSXTransformer.css.
  98. Removed record plone.resources/sinon.deps.
  99. Removed record plone.resources/sinon.url.
  100. Removed record plone.resources/sinon.js.
  101. Removed record plone.resources/sinon.init.
  102. Removed record plone.resources/sinon.export.
  103. Removed record plone.resources/sinon.conf.
  104. Removed record plone.resources/sinon.css.
  105. Added BooleanIndex for field exclude_from_nav.
  106. Indexing new indexes exclude_from_nav.
  107. Cleaned up the toolset registry.
  108. Ran upgrade step: Run to52beta1 upgrade profile.
  109. Role / permission map imported.
  110. Ran upgrade step: Run to52rc1 upgrade profile.
  111. Ran upgrade step: Miscellaneous
  112. Starting rebuild of redirections to add date and manual information.
  113. Done rebuilding redirections.
  114. Ran upgrade step: Rebuild the plone.app.redirector information.
  115. Moved "plone.app.content.interfaces.INameFromTitle" to "plone.namefromtitle"
  116. Moved "plone.app.contenttypes.behaviors.collection.ICollection" to "plone.collection"
  117. Moved "plone.app.dexterity.behaviors.discussion.IAllowDiscussion" to "plone.allowdiscussion"
  118. Moved "plone.app.dexterity.behaviors.id.IShortName" to "plone.shortname"
  119. Moved "plone.app.dexterity.behaviors.exclfromnav.IExcludeFromNavigation" to "plone.excludefromnavigation"
  120. Moved "plone.app.dexterity.behaviors.metadata.IDublinCore" to "plone.dublincore"
  121. Moved "plone.app.contenttypes.behaviors.richtext.IRichTextBehavior" to "plone.richtext"
  122. Moved "plone.app.relationfield.behavior.IRelatedItems" to "plone.relateditems"
  123. Moved "plone.app.lockingbehavior.behaviors.ILocking" to "plone.locking"
  124. Converted dotted behaviors of Collection to named behaviors.
  125. Moved "plone.app.content.interfaces.INameFromTitle" to "plone.namefromtitle"
  126. Moved "plone.app.dexterity.behaviors.discussion.IAllowDiscussion" to "plone.allowdiscussion"
  127. Moved "plone.app.dexterity.behaviors.exclfromnav.IExcludeFromNavigation" to "plone.excludefromnavigation"
  128. Moved "plone.app.dexterity.behaviors.id.IShortName" to "plone.shortname"
  129. Moved "plone.app.dexterity.behaviors.metadata.IDublinCore" to "plone.dublincore"
  130. Moved "plone.app.contenttypes.behaviors.richtext.IRichTextBehavior" to "plone.richtext"
  131. Moved "plone.app.relationfield.behavior.IRelatedItems" to "plone.relateditems"
  132. Moved "plone.app.versioningbehavior.behaviors.IVersionable" to "plone.versioning"
  133. Moved "plone.app.contenttypes.behaviors.tableofcontents.ITableOfContents" to "plone.tableofcontents"
  134. Moved "plone.app.lockingbehavior.behaviors.ILocking" to "plone.locking"
  135. Converted dotted behaviors of Page to named behaviors.
  136. Moved "plone.app.dexterity.behaviors.metadata.IDublinCore" to "plone.dublincore"
  137. Moved "plone.app.content.interfaces.INameFromTitle" to "plone.namefromtitle"
  138. Moved "plone.app.dexterity.behaviors.discussion.IAllowDiscussion" to "plone.allowdiscussion"
  139. Moved "plone.app.dexterity.behaviors.exclfromnav.IExcludeFromNavigation" to "plone.excludefromnavigation"
  140. Moved "plone.app.dexterity.behaviors.id.IShortName" to "plone.shortname"
  141. Moved "Products.CMFPlone.interfaces.constrains.ISelectableConstrainTypes" to "plone.constraintypes"
  142. Moved "plone.app.relationfield.behavior.IRelatedItems" to "plone.relateditems"
  143. Moved "plone.app.dexterity.behaviors.nextprevious.INextPreviousToggle" to "plone.nextprevioustoggle"
  144. Converted dotted behaviors of Folder to named behaviors.
  145. Moved "plone.app.dexterity.behaviors.discussion.IAllowDiscussion" to "plone.allowdiscussion"
  146. Moved "plone.app.dexterity.behaviors.id.IShortName" to "plone.shortname"
  147. Moved "plone.app.dexterity.behaviors.metadata.IDublinCore" to "plone.dublincore"
  148. Moved "plone.app.content.interfaces.INameFromTitle" to "plone.namefromtitle"
  149. Moved "plone.app.dexterity.behaviors.exclfromnav.IExcludeFromNavigation" to "plone.excludefromnavigation"
  150. Moved "plone.app.versioningbehavior.behaviors.IVersionable" to "plone.versioning"
  151. Converted dotted behaviors of Link to named behaviors.
  152. Moved "plone.app.dexterity.behaviors.metadata.ICategorization" to "plone.categorization"
  153. Moved "plone.app.dexterity.behaviors.metadata.IPublication" to "plone.publication"
  154. Moved "plone.app.dexterity.behaviors.metadata.IOwnership" to "plone.ownership"
  155. Moved "plone.app.dexterity.behaviors.filename.INameFromFileName" to "plone.namefromfilename"
  156. Moved "plone.app.dexterity.behaviors.discussion.IAllowDiscussion" to "plone.allowdiscussion"
  157. Moved "plone.app.dexterity.behaviors.id.IShortName" to "plone.shortname"
  158. Moved "plone.app.dexterity.behaviors.exclfromnav.IExcludeFromNavigation" to "plone.excludefromnavigation"
  159. Moved "plone.app.relationfield.behavior.IRelatedItems" to "plone.relateditems"
  160. Converted dotted behaviors of File to named behaviors.
  161. Moved "plone.app.dexterity.behaviors.metadata.ICategorization" to "plone.categorization"
  162. Moved "plone.app.dexterity.behaviors.metadata.IPublication" to "plone.publication"
  163. Moved "plone.app.dexterity.behaviors.metadata.IOwnership" to "plone.ownership"
  164. Moved "plone.app.dexterity.behaviors.discussion.IAllowDiscussion" to "plone.allowdiscussion"
  165. Moved "plone.app.dexterity.behaviors.id.IShortName" to "plone.shortname"
  166. Moved "plone.app.dexterity.behaviors.filename.INameFromFileName" to "plone.namefromfilename"
  167. Moved "plone.app.dexterity.behaviors.exclfromnav.IExcludeFromNavigation" to "plone.excludefromnavigation"
  168. Moved "plone.app.relationfield.behavior.IRelatedItems" to "plone.relateditems"
  169. Converted dotted behaviors of Image to named behaviors.
  170. Moved "plone.app.dexterity.behaviors.metadata.IDublinCore" to "plone.dublincore"
  171. Moved "plone.app.contenttypes.behaviors.richtext.IRichTextBehavior" to "plone.richtext"
  172. Moved "plone.app.content.interfaces.INameFromTitle" to "plone.namefromtitle"
  173. Moved "plone.app.dexterity.behaviors.discussion.IAllowDiscussion" to "plone.allowdiscussion"
  174. Moved "plone.app.dexterity.behaviors.id.IShortName" to "plone.shortname"
  175. Moved "plone.app.dexterity.behaviors.exclfromnav.IExcludeFromNavigation" to "plone.excludefromnavigation"
  176. Moved "plone.app.relationfield.behavior.IRelatedItems" to "plone.relateditems"
  177. Moved "plone.app.contenttypes.behaviors.leadimage.ILeadImageBehavior" to "plone.leadimage"
  178. Moved "plone.app.versioningbehavior.behaviors.IVersionable" to "plone.versioning"
  179. Moved "plone.app.lockingbehavior.behaviors.ILocking" to "plone.locking"
  180. Converted dotted behaviors of News Item to named behaviors.
  181. Moved "plone.app.event.dx.behaviors.IEventBasic" to "plone.eventbasic"
  182. Moved "plone.app.event.dx.behaviors.IEventRecurrence" to "plone.eventrecurrence"
  183. Moved "plone.app.event.dx.behaviors.IEventLocation" to "plone.eventlocation"
  184. Moved "plone.app.event.dx.behaviors.IEventAttendees" to "plone.eventattendees"
  185. Moved "plone.app.event.dx.behaviors.IEventContact" to "plone.eventcontact"
  186. Moved "plone.app.dexterity.behaviors.metadata.IDublinCore" to "plone.dublincore"
  187. Moved "plone.app.content.interfaces.INameFromTitle" to "plone.namefromtitle"
  188. Moved "plone.app.contenttypes.behaviors.richtext.IRichTextBehavior" to "plone.richtext"
  189. Moved "plone.app.dexterity.behaviors.discussion.IAllowDiscussion" to "plone.allowdiscussion"
  190. Moved "plone.app.dexterity.behaviors.exclfromnav.IExcludeFromNavigation" to "plone.excludefromnavigation"
  191. Moved "plone.app.dexterity.behaviors.id.IShortName" to "plone.shortname"
  192. Moved "plone.app.relationfield.behavior.IRelatedItems" to "plone.relateditems"
  193. Moved "plone.app.versioningbehavior.behaviors.IVersionable" to "plone.versioning"
  194. Moved "plone.app.lockingbehavior.behaviors.ILocking" to "plone.locking"
  195. Converted dotted behaviors of Event to named behaviors.
  196. Done moving dotted to named behaviors.
  197. Ran upgrade step: Move from dotted behaviors to named behaviors.
  198. Role / permission map imported.
  199. Ran upgrade step: Miscellaneous
  200. Ran upgrade step: Move registry fields interfaceName for ILanguageSchema
  201. Ran upgrade step: Miscellaneous
  202. Ran upgrade step: Miscellaneous
  203. End of upgrade path, main migration has finished.
  204. Starting upgrade of core addons.
  205. Types tool imported.
  206. 'Discussion Item' type info imported.
  207. Done upgrading core addons.
  208. Your Plone instance is now up-to-date.
复制代码
升级完成后,进入站点管理后台:

其中“操作”和“URL Management”是Plone5.2新增加的内容。
另外,Plone5.2核心还增加了plone.restapi模块,这个模块可以为移动应用开发提供强大支持,详细见官方文档。该模块需要进入
到“附加组件”中安装启用,如下图:


十一、备份生产服务器
  1. bin/snapshotbackup
复制代码

十二、升级生产服务器
安装上述步骤,重新在生产服务器上做一遍,唯一不同的是步骤由原来的开发配置文件buildout_dev.cfg更改为生产部署配置文件config/deploxy.cfg
如此,完成生产服务器升级。

本文原创,欢迎转载,但请注明出去,谢谢!
祝愿同志们好运!!!


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|Plone技术资料 ( 湘ICP备14006519号-1 )

GMT+8, 2019-10-22 08:58 , Processed in 0.048617 second(s), 18 queries , Gzip On.

Powered by Plone! X3.4

© 2001-2019 Plone.org.

快速回复 返回顶部 返回列表