The recommended upgrade path is very old versions of ZMS

Step 1. zms2-2.9.4-41.tar.gz
Step 2. zms2-2.10.3-18_1.tar.gz
Step 3. zms2-2.10.5-24.tar.gz
Step 4. zms2-2.13.4.1555.tar.gz
Step 5. zms-latest.tar.gz

If these steps were not fullfilled or the data are transported via zexp from one system to another, the removal of old ZMS artifacts may not be done automatically. Furthermore an active document history may result in persisting artifacts. In severe cases it is not possible to start Zope anymore. Therefore, in the last executable version or before performing a ZEXP eport the following Zope Python script will reduce the meta model correctly:

Zope-Screen

Typical error messages during ZEXP import due to artifacts of a former content model within the ZMS document tree.
ErrorValue: No module named zmsgraphic
ErrorValue: No module named zmsfile.
The following Python script will remove these artifacts

 

Zope Script for Artifact Removal

## Script (Python) "cleanup_html"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##

# doc_elmnt = container.content
doc_elmnt = context.content

invalid_keys = ['ZMSDocument','ZMSFolder','ZMSGraphic','ZMSLog','ZMSNote','ZMSRubrik','ZMSTable','ZMSTextarea','ZMSSysFolder','ZMSTeaserElement','ZMSTeaserContainer',]

def visit(context):
  rtn = []
  if context.meta_type=='Folder' or context.meta_type.startswith('ZMS'):
    if context.meta_type.startswith('ZMS'):
      d = context.operator_getattr(context,'__dict__')
      rtn.append(context.absolute_url()+" "+context.meta_type+" "+str(filter(lambda x:not x.startswith("_"),d)))
      for x in filter(lambda x:not x.startswith("_"),d.keys()):
        try:
          v = context.operator_getattr(context,x,None)
          if v is not None:
            t = str(context.operator_gettype(v))
            if t=='<type \'Acquisition.ExplicitAcquisitionWrapper\'>':
              context.operator_getattr(context,'_delObject')(x,suppress_events=True)
              rtn.append(context.absolute_url()+" "+context.meta_type+" "+x+" DELETED")
        except:
          rtn.append(context.absolute_url()+" "+context.meta_type+" "+x+" DELETE FAILED")
      for key in ['oRoot','oRootNode','oCurrNode','bInRootTag','bInCData',]:
        val = context.operator_getattr(context,key,None)
        if val is not None:
          context.operator_delattr(context,key)
          rtn.append(context.absolute_url()+" "+context.meta_type+" "+key+" DELETED")
      for key in filter(lambda x:not x.startswith("_"),context.operator_getattr(context,'__dict__')):
        val = context.operator_getattr(context,key,None)
        if val is not None and str(val).startswith('{{') and context.operator_getattr(val,'aq_parent',None) is not None:
          clone = context.operator_getattr(val,'_getCopy')()
          rtn.append("CLONE "+context.absolute_url()+" "+context.meta_type+" "+key+" "+str(context.operator_getattr(clone,'__dict__')))
          context.operator_setattr(context,key,clone)
  for ob in context.objectValues():
    if ob.meta_type in invalid_keys or ob.id in ['Special_Objects','acl_metapatterns'] or str(ob.id).endswith("~"):
      rtn.append(ob.absolute_url()+" "+ob.meta_type+" DELETED")
      context.operator_getattr(context,'_delObject')(ob.id,suppress_events=True)
    elif ob.meta_type=='Folder' or ob.meta_type.startswith('ZMS'):
      rtn.extend(visit(ob))
  return rtn

print '\n'.join(visit(doc_elmnt))
return printed

Erstellt von: Dr. F. Hoffmann , erstellt am:  2012/01/24 , zuletzt geändert: 2019/05/14