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-
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:


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

# 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()):
          v = context.operator_getattr(context,x,None)
          if v is not None:
            t = str(context.operator_gettype(v))
            if t=='<type \'Acquisition.ExplicitAcquisitionWrapper\'>':
              rtn.append(context.absolute_url()+" "+context.meta_type+" "+x+" DELETED")
          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:
          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__')))
  for ob in context.objectValues():
    if ob.meta_type in invalid_keys or in ['Special_Objects','acl_metapatterns'] or str("~"):
      rtn.append(ob.absolute_url()+" "+ob.meta_type+" DELETED")
    elif ob.meta_type=='Folder' or ob.meta_type.startswith('ZMS'):
  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