[Zope-dev] data migration from zope 2.6.1 to zope 2.7.0-b2

altkey myaltkey at msn.com
Wed Feb 4 21:26:31 EST 2004


Hi,

I am fairly new to zope & python but I am working to migrate some 
data/objects from zope 2.6.1 to zope 2.7.0-b2 (and eventually 2.7.0 final.

What I am doing is this.
	(1) get Dublin core metadata + some Dublin core extensions for the objects
	(2) get pure text representation of object content - I can't use  a 
simple import/export in zexp format because the classes in the receiving 
zope instance differ significantly from the classes in the sending zope 
instance.

I am able to collect all the data mentioned above and pass it across to 
the new 2.7.0-b2 zope instance but i am having trouble getting my 
objects to live where they need to live; specifically their path is not 
being accepted properly when i recreate the objects.

here's a code snippet for an external method i am working on

<preliminary stuff removed ...>

def addObjects(self, objectList):

   from Products.CMFCore.PortalFolder import PortalFolder
   from OFS.Moniker import Moniker
   import urllib

   nameList = []
   for myObject in objectList:
     metadata = myObject[0]
     content  = myObject[1]
     dcMetadata = metadata['DC']
     edcMetadata = metadata['EXTENDED_DC']

     name = metadata['OBJECT_ID']
     oType = metadata['TYPE']
     portalType = metadata['PORTAL_TYPE']
     metaType = metadata['META_TYPE']
     DCType = dcMetadata['Type']
     path = metadata['PATH']
     root = metadata['ROOT']

     selfPath = self.getPhysicalPath()

     nameList.append((selfPath,name,portalType,metaType,path))

     self.invokeFactory(portalType,'__'+name)

     q = content['CONTENTS']
     uq = urllib.unquote(q)

     <other code to manipulate the object's content removed ...>

<clean up stuff removed ...>


the line "self.invokeFactory(portalType,'__'+name)" should be creating 
the new objects should be created in the context (self) that the 
external method is executing in - i checked what path 'self' has and it 
is correct (in this case /DF/testStuff).

but instead of being created where I'd expect the new objects are being 
created in /DF

I am sure this all come down to my own inexperience but I would really 
appreciate any advice that a more experiences python/zope person can give.

Cheers,
altkey (aka Phil)





More information about the Zope-Dev mailing list