How to upgrade Odoo with automated migration script
Upgrade your Odoo for free
. What is it about?
This article will guide you on how to upgrade your Odoo instance using a free automated script. You can upgrade any version - for example Odoo 9.0 -> Odoo 10.0, Odoo 10 - Odoo 11. The tutorial was made as simple as possible(even the database was restored from Database Manager). However, some skills are required. Please note that if your current Odoo instance has many custom modules using the script would not be enough. In that case, I would recommend using OpenUpgrade Documentation.
Ready? Let's get started :)
- Odoo installed on Ubuntu server (in this tutorial I am using Odoo9 installed on Amazon EC2 Ubuntu 16,04)
- access to bash
- fresh Odoo install, where migrated version will be set(you can use this tutorial on how to install Odoo)
- please backup your server prior to running through this tutorial
- basic IT skills ;)
3.1 Firstly download the migration script:
3.2 Now you need to know three things to properly run the script:
1) Where is your Odoo config file stored
In this case, it is just in /etc/
2) What is your the name of the database you want to migrate? There are many methods on how to check it - if you are not too tech savvy simple log into Database Manager (www.yourodooinstance/web/database/manager)
As you can see in this case it is "test". Write it down.
3) What version do you want to migrate to? 9.0, 10.0, maybe 11.0? It is up to you.
3.3 Time to run the script
python migrate.py --config=/etc/odoo-server.conf --database=test --run-migrations=10.0
The script will rebuild your Odoo 9.0 and produce a backup file that you can import into Odoo 10 instance.
Once it is done please check the log file to see if there are any issues(I know most of the people won't bother with it).
3.3 Download the backup file
Your migrated Odoo is ready and waiting in the Database Manager. Simply download it and restore in another Odoo instance.
4. Possible errors and fixes
Some things might go wrong. The following solutions won't necessarily work in every single case. There are thousands of them. I have listed just the most common issues
1) "File exists":
rm -rf /var/tmp/openupgrade
pip install future sudo apt-get install python-configparser
3) "Error user access":
service postgresql restart
4) "Peer access error":
As in point 3) simply update pg(remember to change it back to the previous state after migration)
pip install openupgradelib
If you want to access
sudo su - postgres
I have used the following resources:
Important. Migration Script, as well as migration software, is provided by Odoo Community Association. If it was useful for you should consider the donation to OCA, see how you can contribute