quick search:
 

move or rename a cmf site

Submitted by: cleath
Last Edited: 2006-02-07

Category: CMF

Average rating is: 2.0 out of 5 (1 ratings)

Description:
note: go to
http://plone.org/Members/colin/Document.2003-02-22.1833/
for the most current info

as of 2003-02-21-1829 there are four issues you will need to deal with:

1. Updating the paths of your skin directories.

2. Updating the owners of your content.

3. Updating your catalog.

4. Updating any topics or catalog queries that used a hard-coded path.


Source (Text):
for 1:

http://www.zopelabs.com/cookbook/1021216110

for 2:

Thankfully, "Lucas Hofman":http://mail.zope.org/pipermail/zope-cmf/2001-September/009832.html provided a script to show how this can be fixed::

        def fixMembers (self):
            '''fixes ownership of the home areas'''
            import string
            users = self.acl_users
            Members = self.Members
            r=[]
            for i in Members.objectIds():
                try:
                    u = users.getUserById(i)
                    m = getattr (Members, i)
                except:
                    pass
                else:
                    if u is not None:
                        u = u.__of__(users)
                        m.changeOwnership(u,  recursive=1)
                        r.append(i + " changed")
                    else:
                        r.append(i + " not changed")
            return string.join (r,'\n')

Explanation:
To use this script::

Put this script in Extensions dir. Create an external method in the portal
root. and click on the test tab. Create a copy of the Data.fs first....

Note that if you change a file in the Extensions directory, you must reload it (press the *save changes* button) for those changes to take effect.

Before you've used this script, it is best to have taken ownership of the cmf site that you imported.

Note that this script will only fix ownership of objects in the member's directories. If you've moved member-owned content around, you will need to modify this script.


Updating your catalog.

This is easy. Go to portal_catalog. Click on the *catalog* tab to see the current paths of your portal content, e.g.::

/ZopeHosting/freezope/ea.freezope.org/cfu/Members/colin2/test3

Now go to the *advanced* tab and click *update catalog*

Go back to your *catalog* tab, and see how paths have changed, e.g.::

/cfu/Members/colin2/test3


Updating any code or topics that search on path.

I don't have this problem- but if you use path, perhaps you'll find useful the CMFDefault/URLTool.py. However- what you need is the absolute path, so you could just create your own portal property that you could change when you move (that won't help you for TTW topic criteria though), or maybe there's a useful request variable?


Summary:

It's a lot of work! And has plagued many CMF users.

I have filed the following collector issue which if resolved may obviate steps 2-4:

http://collector.zope.org/CMF/133


The proposal is to somehow tie catalog path values and ownership values to portal_url. I hope someone reads this and thinks that s/he could write that patch faster than s/he could write a how-to like this!



Comments:

Error with Lucas Hoffman's script... by benr - 2006-02-07
I try to run the script as directed, but I get this when I click on test:

Line 15: "__of__" is an invalid attribute name because it starts with "_".

Moving plone sites between zope instances seems alot more complicated than it should be...

Thanks for any help!

-Ben Riddell