[Zope] change ClassID of instances

Marcus Schopen marcus@localguru.de
Wed, 20 Mar 2002 22:44:01 +0100


Hi Dieter,

Dieter Maurer wrote:

> Apparently, you want to keep the data but interpete it through
> a different class. Usually, this will cause chaos...
> 
> But you may try the following (on a copy of your Data.fs!):
> 
>   Open "Data.fs" in a text editor.
> 
>   Replace all "*WU....==" by "Products.HTMLDocument.HTMLDocument".
> 
>   Carefully check that everything works fine.
>   There is a high chance that you get further errors.


yes, replacing the ClassID with a editor does not work 100% reliably

here is my solution:

1) I made a backup of my Zope (2.3.3) and set it up on the same linux
box running on WWW Port 8888 and FTP Port 8821. Installed
http://www.zope.org/Members/sf/HTMLDocument as HTMLDocument on the
backup Zope.

2) Then I built the following kernel (2.4.18) modules: ftpfs and davfs
(see ftpfs.sourceforge.net and dav.sourceforge.net).

3) I mounted the backup-Zope with "mount.davfs http://localhost:8888/
/zmnt.new/ -u schoppa -p xxx 0 -U schoppa -G schoppa" to the local linux
file system and

4) and mounted the regular Zope which runs on Ports 8080 and 8021 with
"mount -n -t ftpfs none /zmnt.old/ -o
ip=localhost,user=schoppa,pass=xxx,port=8021,root=/,uid=1001,gid=1001,dmode=775,fmode=775"
to local filesystem too.

[ one need to use ftp module and webdav module, because ftpfs can't
handle multiple ftp sessions (caching problems). With Zope 2.5.0 davfs
works fine for both mount points. ]

5) searched for html files on the regular Zope and wrote the output to a
text file:

   find /zmnt.old -iname *.htm -or -iname *.html > out.txt

6) wrote a little tcl skipt, which copied all html stuff from the
regular server to the backup server:

	#!/usr/bin/tclsh

	set InFile [open out.txt r]

	while {-1 != [gets $InFile Line]} {

  		puts $Line

		  regsub -all {/zmnt.old/} $Line "" tmp

		  if { [file exists /zmnt.new/$tmp] } { exec rm /zmnt.new/$tmp }

		  exec cp $Line /zmnt.new/$tmp

  		puts "o.k."

	}


7) Removed wrapper-HTMLDocument
(http://www.zope.org/Members/unfo/howto_wrapper) from the regular Zope
and install the new HTMLDocument Product
(http://www.zope.org/Members/sf/HTMLDocument)

8) Copied Data.fs from backup Zope to regular Zope and restarted it

9) deleted backup Zope


Cheers,
Marcus


-- 


 ,---- [ Marcus Schopen ] 
|  (0>   
|  //\   P.O. Box 10 25 25
|  V_/_  D-33525 Bielefeld, Germany
|        
 `----

__________________________________________________

Petition for a Software Patent Free Europe 
http://petition.eurolinux.org