You are not logged in Log in Join
You are here: Home » Members » gotcha » Migrate database from storage to storage (from Matt Kromer on zope-db mailing list)

Log in
Name

Password

 

Migrate database from storage to storage (from Matt Kromer on zope-db mailing list)

Question: How do I convert the previously used ZODB data.fs to the newly created Oracle storage data?

You need to migrate your database. It's not terribly hard, but it isn't exactly straightforward either.

What you have to do invoke the copyTransactionsFrom method on the NEW storage with the OLD storage as an argument.

For example:

# # Python script (on the fly example, may not syntax check) # import ZODB from ZODB.FileStorage import FileStorage import DCOracle2 import DCOracleStorage

oldDataFS = FileStorage("/path/to/var/Data.fs") newDataFS=DCOracleStorage.Full( lambda : DCOracle2.connect(user/pw@db), prefix = "zodb_")

newDataFS.copyTransactionsFrom(oldDataFS, verbose=1)

# save that in your lib/python directory and run # it with any corrections that need to be made