← Back to team overview

openupgrade-drivers team mailing list archive

Re: [Question #190482]: [doc] when to use pre- and when to use post- migration?

 

Question #190482 on OpenUpgrade Server changed:
https://answers.launchpad.net/openupgrade-server/+question/190482

    Status: Expired => Answered

Stefan Rijnhart (Therp) changed the question status:
Hi Dmitrijs,

again, apologies for the delayed reply.

In between running the pre- and post-migration scripts, OpenERP reads
the new model definitions from the module code. It updates the database
layout and loads the module's data files. It also instanciates the ORM
objects for the models. That means that you can use the ORM in the post
stage, but not in the pre stage.

The pre stage is used almost exclusively for preserving data that would
otherwise be overwritten or duplicated because it is obsolete or renamed
or moved between modules in the new OpenERP server version.

For everything else use the post stage, to take advantage of the
availability of the ORM.

Cheers,
Stefan.

-- 
You received this question notification because you are a member of
OpenUpgrade Drivers, which is an answer contact for OpenUpgrade Server.