Instructions and step-by-step commands for doing the upgrade from 6.1 to 7 (How to)

Asked by Réal Carbonneau

Please, I wanted to migrate OpenErp 6.1 to version 8, using the script
> migarte.py, package OpenUpgrade-8.0, and I wanted your help on the steps
> to follow setup parameter and execution.
> Thank you for your help.

Question information

Language:
English Edit question
Status:
Solved
For:
OpenUpgrade Server Edit question
Assignee:
No assignee Edit question
Solved by:
Réal Carbonneau
Solved:
Last query:
Last reply:
Revision history for this message
Réal Carbonneau (real-carbonneau) said :
#1

.

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) said :
#2

Hi Réal,

thank you for sharing this. Much appreciated!

Cheers,
Stefan.

Revision history for this message
Mario Gielissen (Openworx) (mario-0) said :
#3

Great piece of software.

Thanks, Mario

Revision history for this message
Thomas Winteler (Win-Soft) (thomi) said :
#4

Hi

Great software.. but maybe it breaks in a multi company instance...
I backuped 6.0 db (pgsql8.4) with GTK 6.0 client and imported it in a 6.1 db (pgsql 9.1) with GTK 6.1 client.. so far so good.
Then i run following, see also output and check all the lines with DETAIL:.... dublicated...

./server/openerp-server -r openerp-testing -w openerp55 --netrpc-port=8070 --xmlrpc-port=8069 --xmlrpcs-port=8071 --db_host=localhost --db_port=5433 --addons-path="/home/thomi/Daten/openerp-dev/openupgrade_6.1/addons" -d winsoft_20121013 -u all --stop-after-init
2012-10-16 11:49:01,653 7496 INFO ? openerp: OpenERP version 6.1
2012-10-16 11:49:01,653 7496 INFO ? openerp: addons paths: /home/thomi/Daten/openerp-dev/openupgrade_6.1/addons
2012-10-16 11:49:01,653 7496 INFO ? openerp: database hostname: localhost
2012-10-16 11:49:01,654 7496 INFO ? openerp: database port: 5433
2012-10-16 11:49:01,654 7496 INFO ? openerp: database user: openerp-testing
2012-10-16 11:49:01,782 7496 INFO ? openerp.addons.web: embedded mode
2012-10-16 11:49:02,191 7496 INFO winsoft_20121013 openerp.modules.loading: module base: loading objects
2012-10-16 11:49:02,193 7496 INFO winsoft_20121013 openerp.modules.migration: module base: Running migration [>6.1.1.3] pre-migration
2012-10-16 11:49:02,193 7496 INFO winsoft_20121013 OpenUpgrade: /home/thomi/Daten/openerp-dev/openupgrade_6.1/base/migrations/6.1.1.3/pre-migration.py called
2012-10-16 11:49:02,195 7496 WARNING winsoft_20121013 OpenUpgrade: No rows affected for query "ALTER TABLE ir_model_fields ADD COLUMN serialization_field_id INTEGER REFERENCES ir_model_fields ON DELETE CASCADE"
2012-10-16 11:49:02,196 7496 INFO winsoft_20121013 OpenUpgrade: table res_users: drop column user_email
2012-10-16 11:49:02,197 7496 WARNING winsoft_20121013 OpenUpgrade: table res_users: column user_email did not exist
2012-10-16 11:49:02,197 7496 INFO winsoft_20121013 OpenUpgrade: table res_users, column email: renaming to user_email
2012-10-16 11:49:02,200 7496 WARNING winsoft_20121013 OpenUpgrade: No rows affected for query "UPDATE ir_module_module SET name = plugin_outlook WHERE name = outlook"
2012-10-16 11:49:02,201 7496 WARNING winsoft_20121013 OpenUpgrade: No rows affected for query "UPDATE ir_model_data SET module = plugin_outlook WHERE module = outlook "
2012-10-16 11:49:02,202 7496 WARNING winsoft_20121013 OpenUpgrade: No rows affected for query "UPDATE ir_module_module SET name = plugin_thunderbird WHERE name = thunderbird"
2012-10-16 11:49:02,254 7496 WARNING winsoft_20121013 OpenUpgrade: No rows affected for query "UPDATE ir_model_data SET module = plugin_thunderbird WHERE module = thunderbird "
2012-10-16 11:49:02,254 7496 WARNING winsoft_20121013 OpenUpgrade: No rows affected for query "UPDATE ir_module_module SET name = mail WHERE name = mail_gateway"
2012-10-16 11:49:02,358 7496 WARNING winsoft_20121013 OpenUpgrade: No rows affected for query "UPDATE ir_model_data SET module = mail WHERE module = mail_gateway "
2012-10-16 11:49:02,469 7496 WARNING winsoft_20121013 OpenUpgrade: No rows affected for query "UPDATE ir_module_module SET demo = false"
2012-10-16 11:49:02,588 7496 INFO winsoft_20121013 openerp.modules.module: module base: creating or updating database tables
2012-10-16 11:49:02,816 7496 ERROR winsoft_20121013 openerp.sql_db: bad query: ALTER TABLE "ir_sequence_type" ADD CONSTRAINT "ir_sequence_type_code_unique" unique(code)
Traceback (most recent call last):
  File "/home/thomi/Daten/openerp-dev/openupgrade_6.1/server/openerp/sql_db.py", line 212, in execute
    res = self._obj.execute(query, params)
IntegrityError: could not create unique index "ir_sequence_type_code_unique"
DETAIL: Key (code)=(g&v_n) is duplicated.

2012-10-16 11:49:02,816 7496 WARNING winsoft_20121013 openerp.osv.orm.schema: Table 'ir_sequence_type': unable to add 'unique(code)' constraint !
 If you want to have it, you should update the records and execute manually:
ALTER TABLE "ir_sequence_type" ADD CONSTRAINT "ir_sequence_type_code_unique" unique(code)
2012-10-16 11:49:07,534 7496 ERROR winsoft_20121013 openerp.sql_db: bad query: ALTER TABLE "res_currency" ADD CONSTRAINT "res_currency_unique_name_company_id" unique (name, company_id)
Traceback (most recent call last):
  File "/home/thomi/Daten/openerp-dev/openupgrade_6.1/server/openerp/sql_db.py", line 212, in execute
    res = self._obj.execute(query, params)
IntegrityError: could not create unique index "res_currency_unique_name_company_id"
DETAIL: Key (name, company_id)=(kr, 1) is duplicated.

2012-10-16 11:49:07,535 7496 WARNING winsoft_20121013 openerp.osv.orm.schema: Table 'res_currency': unable to add 'unique (name, company_id)' constraint !
 If you want to have it, you should update the records and execute manually:
ALTER TABLE "res_currency" ADD CONSTRAINT "res_currency_unique_name_company_id" unique (name, company_id)
2012-10-16 11:49:07,539 7496 ERROR winsoft_20121013 openerp.sql_db: bad query: CREATE UNIQUE INDEX res_currency_unique_name_company_id_idx
                          ON res_currency
                          (name, (COALESCE(company_id,-1)))
Traceback (most recent call last):
  File "/home/thomi/Daten/openerp-dev/openupgrade_6.1/server/openerp/sql_db.py", line 212, in execute
    res = self._obj.execute(query, params)
IntegrityError: could not create unique index "res_currency_unique_name_company_id_idx"
DETAIL: Key (name, (COALESCE(company_id, (-1))))=(kr, 1) is duplicated.

2012-10-16 11:49:07,659 7496 ERROR winsoft_20121013 openerp: Failed to initialize database `winsoft_20121013`.
Traceback (most recent call last):
  File "./server/openerp-server", line 95, in preload_registry
    db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False)
  File "/home/thomi/Daten/openerp-dev/openupgrade_6.1/server/openerp/pooler.py", line 33, in get_db_and_pool
    registry = RegistryManager.get(db_name, force_demo, status, update_module, pooljobs)
  File "/home/thomi/Daten/openerp-dev/openupgrade_6.1/server/openerp/modules/registry.py", line 180, in get
    update_module, pooljobs)
  File "/home/thomi/Daten/openerp-dev/openupgrade_6.1/server/openerp/modules/registry.py", line 202, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/home/thomi/Daten/openerp-dev/openupgrade_6.1/server/openerp/modules/loading.py", line 460, in load_modules
    loaded_modules, processed_modules = load_module_graph(cr, graph, status, perform_checks=(not update_module), report=report, registry=registry)
  File "/home/thomi/Daten/openerp-dev/openupgrade_6.1/server/openerp/modules/loading.py", line 322, in load_module_graph
    init_module_models(cr, package.name, models)
  File "/home/thomi/Daten/openerp-dev/openupgrade_6.1/server/openerp/modules/module.py", line 382, in init_module_models
    obj.init(cr)
  File "/home/thomi/Daten/openerp-dev/openupgrade_6.1/server/openerp/addons/base/res/res_currency.py", line 96, in init
    (name, (COALESCE(company_id,-1)))""")
  File "/home/thomi/Daten/openerp-dev/openupgrade_6.1/server/openerp/sql_db.py", line 152, in wrapper
    return f(self, *args, **kwargs)
  File "/home/thomi/Daten/openerp-dev/openupgrade_6.1/server/openerp/sql_db.py", line 212, in execute
    res = self._obj.execute(query, params)
IntegrityError: could not create unique index "res_currency_unique_name_company_id_idx"
DETAIL: Key (name, (COALESCE(company_id, (-1))))=(kr, 1) is duplicated.

Is it real, that i breaks on a multi company instance?

Thanks for feedback...

regards from swiss-german
thomi

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) said :
#5

Thomas, please post your question as a new topic and we will answer you.

Revision history for this message
Thomas Winteler (Win-Soft) (thomi) said :
#6

additional information..
I checked out res_currency and we use one currency (CHF) for two companies.. in res_currency the company_id column is empty, so we can use the same currency for both companies.. same happens on a customer of us which has about 6 companies sharing the same currency...

thomi

Revision history for this message
ViktorNagy (viktor-nagy) said :
#7

The byr branches are to be currected to

bzr branch lp:openupgrade-server/6.1
bzr branch lp:openupgrade-addons/6.1

Revision history for this message
Holger Brunn (Therp) (hbrunn) said :
#8
Revision history for this message
Alembo (webzz) said :
#9
Revision history for this message
Alembo (webzz) said :
#10

For others that will come acros this:

Instead of
/opt/openupgrade-server/openerp-server --config="/etc/openerp-server.conf" \
    --addons-path="/opt/openupgrade-addons" -d OpenUpgradeTestDB -u all

Do the following

python opt/openupgrade-server/scripts/migrate.py --config=[your openerp-server.conf] --database=[your database] --run-migrations=6.1,7.0

Check the errors at:

/var/tmp/openupgrade/migration.log