zexp import fails from linux to windows due to image file paths

View: New views
6 Messages — Rating Filter:   Alert me  

zexp import fails from linux to windows due to image file paths

by richnz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I have an old zope based site that was hosted on a linux machine that  
was exported to a zexp. i am trying to import it onto a windows  
machine to fix up and upgrade the site. the windows machine is setup  
wth the identical products etc. The problem is the image file paths  
for linux within the zexp do not match the new windows setup. I dont  
need the images imported, i'm wanting to access the main site content  
and users. I dont have access to a linux machine anymore, so i'm stuck  
with windows for development. Is there a way of getting the import  
procedure to ignore the errors and continue the import (i.e. any hints  
on how to modify the zope code)? Or is there a way to edit the zexp to  
do a search & remove/replace of the file path names so the import  
completes with no file path details?

Any ideas greatly appreciated as I have searched around with no luck on
answering this myself.

Thanks

_______________________________________________
Zope maillist  -  Zope@...
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Re: zexp import fails from linux to windows due to image filepaths

by Jaroslav Lukesh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

From: "Richard Ettema" <richard@...>
> with windows for development. Is there a way of getting the import
> procedure to ignore the errors and continue the import (i.e. any hints  on
> how to modify the zope code)? Or is there a way to edit the zexp to  do a
> search & remove/replace of the file path names so the import  completes
> with no file path details?

You need to export your website folder as ZEXP in XML format. Then you could
edit this file at search/replace basis. But before this, try to re-import
this ZEXP file, if it is able to import (not all zexp exports are able to
reimport).

Regards, JL.

_______________________________________________
Zope maillist  -  Zope@...
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Re: zexp import fails from linux to windows due to image filepaths

by richnz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Quoting Jaroslav Lukesh <lukesh@...>:

>
> You need to export your website folder as ZEXP in XML format. Then you
> could edit this file at search/replace basis. But before this, try to
> re-import this ZEXP file, if it is able to import (not all zexp exports
> are able to reimport).
>
> Regards, JL.

Thanks for the reply JL, re-importing into the original server and  
exporting in XML is not an option as I don't have the server anymore,  
only a Windows machine.
If editing the existing ZEXP is not possible, is it possible to modify  
the actual zope code temporarily, to ignore the mismatch of file paths  
(or to modify the paths from linux to windows during the import  
process)?
Thanks, Rich

_______________________________________________
Zope maillist  -  Zope@...
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Re: zexp import fails from linux to windows due to image file paths

by robert rottermann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Richard Ettema schrieb:

> Hi,
>
> I have an old zope based site that was hosted on a linux machine that
> was exported to a zexp. i am trying to import it onto a windows machine
> to fix up and upgrade the site. the windows machine is setup wth the
> identical products etc. The problem is the image file paths for linux
> within the zexp do not match the new windows setup. I dont need the
> images imported, i'm wanting to access the main site content and users.
> I dont have access to a linux machine anymore, so i'm stuck with windows
> for development. Is there a way of getting the import procedure to
> ignore the errors and continue the import (i.e. any hints on how to
> modify the zope code)? Or is there a way to edit the zexp to do a search
> & remove/replace of the file path names so the import completes with no
> file path details?
>
> Any ideas greatly appreciated as I have searched around with no luck on
> answering this myself.
>
i do not think that it is the zexp import machinery that fails but the product
that handles these external images. so you have to fix that product that it does
not chocke when it can not read a file.

robert
_______________________________________________
Zope maillist  -  Zope@...
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Re: zexp import fails from linux to windows due to image filepaths

by TheyCallHimTim :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You can use this to edit the zexp on the command line. It is from the
cygwin build system.

perl -pe 'BEGIN{binmode(STDIN); binmode(STDOUT);};
s/oldtext/newtext/g'  < copy_of_your.zexp  > fixed_copy_of_your.zexp

then rename fixed_copy_of_your.zexp to the original zexp name and
import it into a NON-Production version of zope.

I have used this to edit binary data but I've not tried the zexp
import. Be careful because it looks like ExportImport.py in ZODB will
try to register any python pickle that begins with ZEXP.  This could
really mess up your data.

Unfortunately there doesn't seem to be many zexp manipulation scripts available.

Good luck!
Tim


On 7/16/08, Richard Ettema <richard@...> wrote:

> Quoting Jaroslav Lukesh <lukesh@...>:
>
>>
>> You need to export your website folder as ZEXP in XML format. Then you
>> could edit this file at search/replace basis. But before this, try to
>> re-import this ZEXP file, if it is able to import (not all zexp exports
>> are able to reimport).
>>
>> Regards, JL.
>
> Thanks for the reply JL, re-importing into the original server and
> exporting in XML is not an option as I don't have the server anymore,
> only a Windows machine.
> If editing the existing ZEXP is not possible, is it possible to modify
> the actual zope code temporarily, to ignore the mismatch of file paths
> (or to modify the paths from linux to windows during the import
> process)?
> Thanks, Rich
>
> _______________________________________________
> Zope maillist  -  Zope@...
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>
_______________________________________________
Zope maillist  -  Zope@...
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Re: zexp import fails from linux to windows due to image file paths

by richnz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


>>
> i do not think that it is the zexp import machinery that fails but the
> product that handles these external images. so you have to fix that
> product that it does not chocke when it can not read a file.
>
> robert

Hi,
Thanks for all your replies. Robert, I modified the products causing  
the errors as you suggested and was able to import the zexp without  
any problems, thanks!
Richard.

_______________________________________________
Zope maillist  -  Zope@...
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )