How to upgrade odoo 8 to odoo 9 database?

有些话、适合烂在心里 提交于 2019-11-30 16:08:36

问题


I am trying to upgrade an odoo installation from 8.0 to 9.0. What I've done so far is the following:

  • Backup the odoo database from the production system
  • Installed the backup DB as test in my current system
  • Copied the odoo folder in a folder on my system
  • Checked, if everything works. It works!
  • Updated to the latest v8.0 version, still works
  • Did a git checkout 9.0 followed by a git pull.
  • Started odoo 9.0 with the command ./openerp-server -d testDB -u all

This commands breaks with the following error and does not update my database:

LINE 1: select model, transient from ir_model where state='manual'
                      ^
, in query select model, transient from ir_model where state=%s
 2015-10-26 00:37:29,823 4501 CRITICAL testDB openerp.service.server:
Failed to initialize database `testDB`.
 Traceback (most recent call last):
  File "/opt/odoo/openerp/service/server.py", line 885, in preload_registries
    registry = RegistryManager.new(dbname, update_module=update_module)
File "/opt/odoo/openerp/modules/registry.py", line 385, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
File "/opt/odoo/openerp/modules/loading.py", line 279, in load_modules
loaded_modules, processed_modules = load_module_graph(cr, graph, status, perform_checks=update_module, report=report)
File "/opt/odoo/openerp/modules/loading.py", line 136, in load_module_graph
registry.setup_models(cr, partial=True)
File "/opt/odoo/openerp/modules/registry.py", line 185, in setup_models
cr.execute('select model, transient from ir_model where state=%s', ('manual',))
File "/opt/odoo/openerp/sql_db.py", line 139, in wrapper
   return f(self, *args, **kwargs)
File "/opt/odoo/openerp/sql_db.py", line 215, in execute
   res = self._obj.execute(query, params)

ProgrammingError: column "transient" does not exist
LINE 1: select model, transient from ir_model where state='manual'

Are there any steps which I have to follow to upgrade the database or has everything to be done by hand? And if yes, what should I do? Obviously it failed because the specific column is non-existent in my database. But is there any update script because I fear, if I change this there will be the next error waiting for me.

Thanks in advance.


回答1:


You can ask the odoo company to do that task for you by going to this link .But they will charge money for that. If you can do it yourself here is the documentation on how to do that, https://doc.therp.nl/openupgrade/intro.html

Option 2: We can use pgadmin(postgresql gui tool).Just select your database name and in the top you can see sql enabled,click it and issue an sql query to display all data(you must know the table name which you want to retreive) after that you can export it.The exported file contains all the data with column headings,we may have to rearrange columns according to odoo9 DB.Once it is done select odoo9 database,right click on the table name which you want to import data to and select import option.It may take a while and it should give message as "data imported successfully".




回答2:


I found the answer on Github.

The trick is to create a field called transient which is Boolean with the default value false in the table ir_model.

As I expected, this is not the complete solution as there are other problem with the database needing adjustments.




回答3:


You are trying to run a Odoo 8.0 database on Odoo 9.0.

The column 'transient' is in the code base for 9.0 and not in the 8.0 code base. Hence the 8.0 database is being ran on the 9.0 code base. Hence, the database has not been upgraded properly.

As stated in the previous answer. You can either get Odoo to do it or can do it yourself as well.



来源:https://stackoverflow.com/questions/33336830/how-to-upgrade-odoo-8-to-odoo-9-database

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!