Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install dm.zodb.repair

How to install dm.zodb.repair

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install dm.zodb.repair
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.0 Available View build log
Windows (64-bit)
1.0 Available View build log
Mac OS X (10.5+)
1.0 Available View build log
Linux (32-bit)
1.0 Available View build log
Linux (64-bit)
1.0 Available View build log
 
Author
License
ZPL
Imports
Lastest release
version 1.0 on Jan 5th, 2011

This package contains a function to restore lost objects from a ZODB backup. In the future, it might grow further tools for ZODB repair.

recover.restore_from_backup

The module recover defines the function restore_from_backup to restore lost objects from a ZODB backup. restore_from_backup has parameters lost, backup and target.

lost is an iterable of oids identifying objects lost in target. The oids might e.g. have been found by the standard fsrefs utility.

backup and target are open ZODB storages. backup is read only and can have been opened read only; target is read and written.

restore_from_backup reads the objects identified by the oids in lost from backup and writes them to target. If such a restored object contains references to other objects not available in target, they are restored recursively. The operations are logged via Python's standard logging subsystem.

Example usage:

System Message: WARNING/2 (<string>, line 25)

Literal block expected; none found.

from logging import basicConfig, getLogger, INFO from ZODB.FileStorage.FileStorage import FileStorage from dm.zodb.repair.recover import restore_from_backup

basicConfig() logger = getLogger(); logger.setLevel(INFO)

lost = [....] # list of oids for lost objects, e.g. derived from "fsrefs" output

backup = FileStorage('backup.fs', read_only=True) target = FileStorage('target.fs') restore_from_backup(lost, backup, target) backup.close() target.close()

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.