To run Odoo 8 and Odoo 9 on the same server, you’ll need to set up both versions to coexist without conflicts. Here’s a step-by-step guide to do that:
1. Install Dependencies for Both Odoo Versions
Odoo 8 and Odoo 9 require different Python dependencies. You need to install them separately to avoid version conflicts.
- For Odoo 8, you’ll need Python 2.7.
- For Odoo 9, you’ll need Python 2.7 as well, but the library versions might differ. To install the required dependencies for both versions, you can use the following commands:
sudo apt-get install python-dev python-pip build-essential libxml2-dev libxslt1-dev libssl-dev libffi-dev
sudo apt-get install python-virtualenv
2. Create Virtual Environments for Each Version
Create separate Python virtual environments for Odoo 8 and Odoo 9. This isolates the dependencies for each version.
- For Odoo 8:
virtualenv -p /usr/bin/python2.7 ~/odoo8-venv source ~/odoo8-venv/bin/activate pip install -r odoo8/requirements.txt deactivate
- For Odoo 9:
bash virtualenv -p /usr/bin/python2.7 ~/odoo9-venv source ~/odoo9-venv/bin/activate pip install -r odoo9/requirements.txt deactivate
3. Install and Configure PostgreSQL
Odoo requires PostgreSQL to manage its databases. Install PostgreSQL if it’s not already installed:
sudo apt-get install postgresql
Create two users and two databases for each Odoo version:
- For Odoo 8:
sudo su - postgres createuser --createdb --username postgres --no-createrole --no-superuser --no-password odoo8 createdb -O odoo8 odoo8_db exit
- For Odoo 9:
bash sudo su - postgres createuser --createdb --username postgres --no-createrole --no-superuser --no-password odoo9 createdb -O odoo9 odoo9_db exit
4. Configure Separate Odoo Configuration Files
Create separate configuration files for each Odoo version in /etc/
.
- For Odoo 8:
sudo nano /etc/odoo8.conf
Example configuration for Odoo 8:[options] addons_path = /path/to/odoo8/addons db_host = False db_port = False db_user = odoo8 db_password = False xmlrpc_port = 8068 logfile = /var/log/odoo/odoo8.log
- For Odoo 9:
sudo nano /etc/odoo9.conf
Example configuration for Odoo 9:[options] addons_path = /path/to/odoo9/addons db_host = False db_port = False db_user = odoo9 db_password = False xmlrpc_port = 8069 logfile = /var/log/odoo/odoo9.log
Make sure each version runs on a different port (like 8068 for Odoo 8 and 8069 for Odoo 9).
5. Start Odoo Services
- For Odoo 8, start the service by running the following command:
~/odoo8-venv/bin/python /path/to/odoo8/odoo.py --config=/etc/odoo8.conf
- For Odoo 9, start the service similarly:
~/odoo9-venv/bin/python /path/to/odoo9/odoo.py --config=/etc/odoo9.conf
If you want both services to run in the background as daemons, you can create systemd service files for each version.
6. Access Odoo 8 and Odoo 9
- Odoo 8 will be accessible at:
http://your-server-ip:8068
- Odoo 9 will be accessible at:
http://your-server-ip:8069
7. Use Different Databases for Each Version
Be sure to use different databases for Odoo 8 and Odoo 9 to avoid conflicts. You can specify the database in the Odoo interface when logging in, or you can set the dbfilter
option in the configuration files.
By following these steps, you can successfully run Odoo 8 and Odoo 9 side by side on the same server.
Conclusion
To easily run both Odoo 8 as well as Odoo 9 on the similar server, you just simply want to configure both versions to exist without any issue. Here above is a complete step-by-step guide to simply do this with the help of managed Odoo server solutions.