Extract Files from ZODB
I have a ZODB that was being used by Plone to store files(Word documents, Images, etc.). Plone is no longer working. I want to extract (retrieve) the files from the ZODB. Is this possible? If so, how is this accomplished. Note: I cannot access Plone or anything in Plone because it is not working. I am looking for a solution that involves working only with ZODB through Zope, not a procedure that attempts to troubleshoot Plone.
----- Original Message ----- From: "Carlosfocker" <carlosfocker@gmail.com> To: <zope@zope.org> Sent: Tuesday, February 13, 2007 1:25 PM Subject: [Zope] Extract Files from ZODB
I have a ZODB that was being used by Plone to store files(Word documents, Images, etc.). Plone is no longer working. I want to extract (retrieve) the files from the ZODB. Is this possible? If so, how is this accomplished. Note: I cannot access Plone or anything in Plone because it is not working. I am looking for a solution that involves working only with ZODB through Zope, not a procedure that attempts to troubleshoot Plone.
If the documents were stored as 'Files' then you can do a search by meta-type: for fileObj in container.objectValues('File'): <do something with the file> You would need to recurse through your directory (folder) structure to get every file (unless they were stored in known folders). Jonathan
Is that Python? Where should I be executing this code. Do I create a python script? I'm not a python programmer. If you can help guide help I would be grateful.
----- Original Message ----- From: "Carlosfocker" <carlosfocker@gmail.com> To: <zope@zope.org> Sent: Tuesday, February 13, 2007 3:57 PM Subject: [Zope] Re: Extract Files from ZODB
Is that Python? Where should I be executing this code. Do I create a python script? I'm not a python programmer. If you can help guide help I would be grateful.
This code (from previous msg): for fileObj in container.objectValues('File'): <do something with the file> is python and can be executed in either a python script or an external method (depends on what you want to do with the file object once you have it). You are going to have learn some python! Jonathan
Carlosfocker wrote at 2007-2-13 18:25 +0000:
I have a ZODB that was being used by Plone to store files(Word documents, Images, etc.). Plone is no longer working. I want to extract (retrieve) the files from the ZODB. Is this possible?
Whether this is possible (without deep tricks) depends on what "Plone is no longer working" means. Keep in mind that the ZODB stores object states only but no code whatsoever. To understand the states, working external (application) code is necessary. "If Plone is no longer working" means that the "Plone" instance object can no longer be loaded from the ZODB, then the code is missing that provides understanding for the "Plone" instance object's state. Somewhere deep inside this state are your files.... "If Plone is no longe working" means that the "Plone" UI no longer works but the Zope Management Interface still operates, then you have hope that you can recover your files. Even in the first case, there is some hope: you can go back to the Plone version that created the state. This version should be able to understand it. -- Dieter
"If Plone is no longe working" means that the "Plone" UI no longer works but the Zope Management Interface still operates, then you have hope that you can recover your files.
This would be my current situation as far as "Plone is no longer working". I cant get to any pages inside of the plone instance but the ZMI is accessiable. I cant however do anything to the Plone site thru the ZMI.
Carlosfocker wrote at 2007-2-14 22:46 +0000:
"If Plone is no longe working" means that the "Plone" UI no longer works but the Zope Management Interface still operates, then you have hope that you can recover your files.
This would be my current situation as far as "Plone is no longer working". I cant get to any pages inside of the plone instance but the ZMI is accessiable.
You would access the ZODB directly (under *nix with "bin/zopectl debug"; for Windows, there are equivalent solutions (search the mailing list archives)). You would activate there a function that recursively traverses your Plone instance (maybe using "OFS.FindSupport.ZopeFind"), detects objects valuable for you (probably "CMFFile" objects) and store their content ("str(obj.data)") into the file system. -- Dieter
participants (3)
-
Carlosfocker -
Dieter Maurer -
Jonathan