[IMP] Documentation

This commit is contained in:
Sylvain LE GAL 2022-06-02 11:28:42 +02:00
parent 44fd15b45c
commit d7dda07c2b

View File

@ -13,8 +13,10 @@ upgrade of Odoo Community Edition. (formely OpenERP).
It works with Openupgrade OCA tools. (https://github.com/oca/openupgrade)
this tool is useful for complex migrations:
- skip several versions
- complex custom code
- migrate several versions
- take advantage of the migration to install / uninstall modules
- execute sql requests or click-odoo scripts between each migration
- analyse workload
It will create a migration environment (with all the code available)
and provides helpers to run (and replay) migrations until it works.
@ -25,8 +27,17 @@ and provides helpers to run (and replay) migrations until it works.
# Installation
``pipx install odoo-openupgrade-wizard``.
**Prerequites**
* You should have docker installed on your system
* the tools run on debian system
**Installation**
``pipx install odoo-openupgrade-wizard``
(coming soon. Not still deployed on pyp ! See alternative installation
in ``DEVELOP.md`` file.)
# Usage
@ -46,24 +57,21 @@ Initialize a folder to make a migration from a 10.0 and a 12.0 database.
This will generate the following structure :
```
config.yml
modules.csv
filestore/
log/
2022_03_25__23_12_41__init.log
...
postgres_data/
scripts/
step_1__update__10.0/
pre-migration.sql
post-migration.py
step_2__upgrade__11.0/
pre-migration.sql
post-migration.py
step_2__upgrade__12.0/
pre-migration.sql
post-migration.py
...
step_3__upgrade__12.0/
...
step_4__update__12.0/
pre-migration.sql
post-migration.py
...
src/
env_10.0/
debian_requirements.txt
@ -72,13 +80,12 @@ src/
python_requirements.txt
repos.yml
src/
odoo/
openupgrade/
env_11.0/
...
env_12.0/
...
config.yml
modules.csv
```
* ``config.xml`` is the main configuration file of your project.
@ -90,11 +97,16 @@ src/
* ``log`` folder will contains all the log of the ``odoo-openupgrade-wizard``
and the logs of the odoo instance that will be executed.
* ``filestore`` folder will contains the filestore of the odoo database(s)
* ``postgres_data`` folder will be used by postgres docker image to store
database.
* ``scripts`` folder contains a folder per migration step. In each step folder:
- ``pre-migration.sql`` can contains extra SQL queries you want to execute
before beginning the step.
- ``post-migration.py`` can contains extra python command to execute
after the execution of the step. (the orm will be available)
after the execution of the step.
Script will be executed with ``click-odoo`` command. All the ORM is available
via the ``env`` variable.
@ -115,16 +127,22 @@ src/
required to run the odoo instance.
- ``odoo.cfg`` file. Add here extra configuration required for your custom modules.
the classical keys (``db_host``, ``db_port``, etc...) are automatically autogenerated.
the classical keys (``db_host``, ``db_port``, etc...) are automatically
autogenerated.
At this step, you should change the autogenerated files.
You can use default files, if you have a very simple odoo instance without custom code,
extra repositories, or dependencies...
**Note:**
- In your repos.yml, preserve ``openupgrade`` and ``server-tools`` repositories
to have all the features of the librairies available.
## ``odoo-openupgrade-wizard get-code``
Prerequites : init
```
odoo-openupgrade-wizard get-code
```
@ -150,6 +168,8 @@ odoo-openupgrade-wizard get-code --releases 10.0,11.0
## ``odoo-openupgrade-wizard docker-build``
Prerequites : init + get-code
This will build local docker images that will be used in the following steps.
This script will pull official odoo docker images, defined in the ``Dockerfile`` of
@ -179,7 +199,9 @@ odoo-openupgrade-wizard-image---my-customer-10-12---10.0 latest 9d94dce2bd4
## ``odoo-openupgrade-wizard run``
## ``odoo-openupgrade-wizard run`` (BETA)
Prerequites : init + get-code + build
```
odoo-openupgrade-wizard run\
@ -206,6 +228,8 @@ at your host, at the following url : http://localhost:9069
## ``odoo-openupgrade-wizard install-from-csv``
Prerequites : init + get-code + build
```
odoo-openupgrade-wizard install-from-csv\
--database DB_NAME
@ -218,7 +242,9 @@ The database will be created, if it doesn't exists.
## ``odoo-openupgrade-wizard upgrade``
## ``odoo-openupgrade-wizard upgrade`` (BETA)
Prerequites : init + get-code + build
```
odoo-openupgrade-wizard upgrade\
@ -243,7 +269,9 @@ For each step, it will :
## ``odoo-openupgrade-wizard generate-module-analysis``
## ``odoo-openupgrade-wizard generate-module-analysis`` (BETA)
Prerequites : init + get-code + build
```
odoo-openupgrade-wizard generate-module-analysis\
@ -257,3 +285,19 @@ and the previous version. It will generate analysis_file.txt files present
in OpenUpgrade project.
You can also use this fonction to analyze differences for custom / OCA modules
between several versions, in case of refactoring.
## ``odoo-openupgrade-wizard estimate-workload``
Prerequites : init + get-code
```
odoo-openupgrade-wizard estimate-workload
```
Generate an HTML file name ``analysis.html`` with all the information regarding
the work to do for the migration.
- checks that the modules are present in each version. (by managing the
renaming or merging of modules)
- check that the analysis and migration have been done for the official
modules present in odoo/odoo