odoo-openupgrade-wizard


Nameodoo-openupgrade-wizard JSON
Version 0.7.0 PyPI version JSON
download
home_pagehttps://gitlab.com/odoo-openupgrade-wizard/odoo-openupgrade-wizard
SummaryCLI tool to manage Odoo Major Upgrades
upload_time2024-05-02 21:56:53
maintainerSylvain LE GAL
docs_urlNone
authorGRAP, Groupement Régional Alimentaire de Proximité
requires_python<4.0.0,>=3.9
licenseAGPLv3+
keywords cli odoo openupgrade
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Gitlab CI](https://gitlab.com/odoo-openupgrade-wizard/odoo-openupgrade-wizard/badges/main/pipeline.svg)](https://gitlab.com/odoo-openupgrade-wizard/odoo-openupgrade-wizard/-/pipelines)
[![codecov](https://gitlab.com/odoo-openupgrade-wizard/odoo-openupgrade-wizard/badges/main/coverage.svg)](https://gitlab.com/odoo-openupgrade-wizard/odoo-openupgrade-wizard/)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/odoo-openupgrade-wizard)
![PyPI - Downloads](https://img.shields.io/pypi/dm/odoo-openupgrade-wizard)
![GitLab last commit](https://img.shields.io/gitlab/last-commit/34780558)
![GitLab stars](https://img.shields.io/gitlab/stars/34780558?style=social)

# odoo-openupgrade-wizard

Odoo Openupgrade Wizard is a tool that helps developpers to make major
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:
- migrate several versions
- take advantage of the migration to install / uninstall modules
- execute sql requests or odoo shell 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.

* To develop and contribute to the library, refer to the ``DEVELOP.md`` file.
* Refer to the ``ROADMAP.md`` file to see the current limitation, bugs, and task to do.
* See authors in the ``CONTRIBUTORS.md`` file.

# Table of Contents

* [Installation](#installation)
* [Usage](#usage)
    * [Command ``init``](#command-init)
    * [Command ``pull-submodule``](#command-pull-submodule)
    * [Command ``get-code``](#command-get-code)
    * [Command ``docker-build``](#command-docker-build)
    * [Command ``run`` (BETA)](#command-run)
    * [Command ``install-from-csv``](#command-install-from-csv)
    * [Command ``upgrade`` (BETA)](#command-upgrade)
    * [Command ``generate-module-analysis`` (BETA)](#command-generate-module-analysis)
    * [Command ``estimate-workload`` (BETA)](#command-estimate-workload)
    * [Command ``psql``](#command-psql)
    * [Command ``copydb``](#command-copydb)
    * [Command ``dropdb``](#command-dropdb)
    * [Command ``dumpdb``](#command-dumpdb)

<a name="installation"/>

# Installation

**Prerequites:**

* The tools run on debian system
* You should have docker installed on your system
* Some features require extra packages. To have all the features available run:

**Installation:**

The library is available on [PyPI](https://pypi.org/project/odoo-openupgrade-wizard/).

To install it simply run :

``pipx install odoo-openupgrade-wizard``

(See alternative installation in ``DEVELOP.md`` file.)

<a name="usage"/>

# Usage

**Note:**

the term ``odoo-openupgrade-wizard`` can be replaced by ``oow``
in all the command lines below.

<a name="command-init"/>

## Command: ``init``

```
odoo-openupgrade-wizard init\
  --initial-version=10.0\
  --final-version=12.0\
  --project-name=my-customer-10-12\
  --extra-repository=OCA/web,OCA/server-tools
```

Initialize a folder to make a migration from a 10.0 and a 12.0 database.
This will generate the following structure :

```
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/
        ...
    step_3__upgrade__12.0/
        ...
    step_4__update__12.0/
        ...
src/
    env_10.0/
        extra_debian_requirements.txt
        Dockerfile
        odoo.conf
        extra_python_requirements.txt
        repos.yml
        src/
    env_11.0/
        ...
    env_12.0/
        ...
config.yml
modules.csv
```

* ``config.yml`` is the main configuration file of your project.

* ``modules.csv`` file is an optional file. You can fill it with the list
  of your modules installed on your production. The first column of this
  file should contain the technical name of the module.

* ``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.
    Script will be executed with ``odoo shell`` command. All the ORM is available
    via the ``env`` variable.

* ``src`` folder contains a folder per Odoo version. In each environment folder:

    - ``repos.yml`` enumerates the list of the repositories to use to run the odoo instance.
      The syntax should respect the ``gitaggregate`` command.
      (See : https://pypi.org/project/git-aggregator/)
      Repo files are pre-generated. You can update them with your custom settings.
      (custom branches, extra PRs, git shallow options, etc...)

    - ``extra_python_requirements.txt`` enumerates the list of extra python librairies
      required to run the odoo instance.
      The syntax should respect the ``pip install -r`` command.
      (See : https://pip.pypa.io/en/stable/reference/requirements-file-format/)

    - ``extra_debian_requirements.txt`` enumerates the list of extra system librairies
      required to run the odoo instance.

    - ``odoo.conf`` file. Add here extra configuration required for your custom modules.
      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.
- In your repos.yml file, the odoo project should be in ``./src/odoo``
  and the openupgrade project should be in ``./src/openupgrade/`` folder.

<a name="command-pull-submodule"/>

## Command: ``pull-submodule``

**Prerequites:** init

if you already have a repos.yml file on github / gitlab, it can be convenient to
synchronize the repository, instead of copy past the ``repos.yml`` manually.

In that case, you can add extra values, in the ``config.yml`` file in the section

```
odoo_version_settings:
  12.0:
      repo_url: url_of_the_repo_that_contains_a_repos_yml_file
      repo_branch: 12.0
      repo_file_path: repos.yml
```

then run following command :

```
odoo-openupgrade-wizard pull-submodule
```

<a name="command-get-code"/>

## Command: ``get-code``

**Prerequites:** init

```
odoo-openupgrade-wizard get-code
```

This command will simply get all the Odoo code required to run all the steps
for your migration with the ``gitaggregate`` tools.

The code is defined in the ``repos.yml`` of each environment folders. (or in the
directory ``repo_submodule`` if you use ``pull-submodule`` feature.)

**Note**

* This step could take a big while !

**Optional arguments**

if you want to update the code of some given versions, you can provide an extra parameter:

```
odoo-openupgrade-wizard get-code --versions 10.0,11.0
```

<a name="command-docker-build"/>

## Command: ``docker-build``

**Prerequites:** init + get-code

This will build local docker images that will be used in the following steps.

At this end of this step executing the following command should show a docker image per version.


```
$ docker images --filter "reference=odoo-openupgrade-wizard-*"

REPOSITORY                                                 TAG       IMAGE ID       CREATED       SIZE
odoo-openupgrade-wizard-image---my-customer-10-12---12.0   latest    ef664c366208   2 weeks ago   1.39GB
odoo-openupgrade-wizard-image---my-customer-10-12---11.0   latest    24e283fe4ae4   2 weeks ago   1.16GB
odoo-openupgrade-wizard-image---my-customer-10-12---10.0   latest    9d94dce2bd4e   2 weeks ago   924MB
```

**Optional arguments**

* if you want to (re)build an image for some given versions, you can provide
  an extra parameter: ``--versions 10.0,12.0``

**Note**

* This step could take a big while also !


<a name="command-run"/>

## Command: ``run`` (BETA)

**Prerequites:** init + get-code + build

```
odoo-openupgrade-wizard run\
    --step 1\
    --database DB_NAME
```

Run an Odoo instance with the environment defined by the step argument.

The database will be created, if it doesn't exists.

if ``stop-after-init`` is disabled, the odoo instance will be available
at your host, at the following url : http://localhost:9069
(Port depends on your ``host_odoo_xmlrpc_port`` setting of your ``config.yml`` file)

**Optional arguments**

* You can add ``--init-modules=purchase,sale`` to install modules.

* You can add ``stop-after-init`` flag to turn off the process at the end
  of the installation.


<a name="command-install-from-csv"/>

## Command: ``install-from-csv``

**Prerequites:** init + get-code + build

```
odoo-openupgrade-wizard install-from-csv\
    --database DB_NAME
```

Install the list of the modules defined in your ``modules.csv`` files on the
given database.

The database will be created, if it doesn't exists.

To get a correct ``modules.csv`` file, the following query can be used:
```
psql -c "copy (select name, shortdesc from ir_module_module where state = 'installed' order by 1) to stdout csv" coopiteasy
```


<a name="command-upgrade"/>

## Command: ``upgrade`` (BETA)

**Prerequites:** init + get-code + build

```
odoo-openupgrade-wizard upgrade\
    --database DB_NAME
```

Realize an upgrade of the database from the initial version to
the final version, following the different steps.

For each step, it will :

1. Execute the ``pre-migration.sql`` of the step.
2. Realize an "update all" (in an upgrade or update context)
3. Execute the scripts via XML-RPC (via ``odoorpc``) defined in
   the ``post-migration.py`` file.

**Optional arguments**

* You can add ``--first-step=2`` to start at the second step.

* You can add ``--last-step=3`` to end at the third step.


<a name="command-generate-module-analysis"/>

## Command: ``generate-module-analysis`` (BETA)

**Prerequites:** init + get-code + build

```
odoo-openupgrade-wizard generate-module-analysis\
    --database DB_NAME
    --step 2
    --modules MODULE_LIST
```

Realize an analyze between the target version (in parameter via the step argument)
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.

<a name="command-estimate-workload"/>

## Command: ``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

<a name="command-psql"/>

## Command: ``psql``

**Prerequites:** init

```
odoo-openupgrade-wizard psql
    --database DB_NAME
    --command "SQL_REQUEST"
```

Execute an SQL Request on the target database.

**Optional arguments**

* If no ``database`` is provided, default ``postgres`` database will be used. exemple:

```
odoo-openupgrade-wizard psql --command "\l";
```
Result:
```
                              List of databases
    Name    | Owner | Encoding |  Collate   |   Ctype    | Access privileges
------------+-------+----------+------------+------------+-------------------
 postgres   | odoo  | UTF8     | en_US.utf8 | en_US.utf8 |
 template0  | odoo  | UTF8     | en_US.utf8 | en_US.utf8 | =c/odoo          +
            |       |          |            |            | odoo=CTc/odoo
 template1  | odoo  | UTF8     | en_US.utf8 | en_US.utf8 | =c/odoo          +
            |       |          |            |            | odoo=CTc/odoo
 test_psql  | odoo  | UTF8     | en_US.utf8 | en_US.utf8 |

```

* if you execute request that return long result, you can choose to select ``pager`` or ``-no-pager``
  option to display the result via the click function ``echo_via_pager``.
  (see : https://click.palletsprojects.com/en/8.1.x/utils/#pager-support)

Note : Pager is enabled by default.


* you can pass extra psql arguments inline.

```
odoo-openupgrade-wizard psql
    --database=test_psql
    --command "select id, name from res_partner where name ilike '%admin%';"
    -H
```
Result:
```
<table border="1">
  <tr>
    <th align="center">id</th>
    <th align="center">name</th>
  </tr>
  <tr valign="top">
    <td align="right">3</td>
    <td align="left">Administrator</td>
  </tr>
</table>
<p>(1 row)<br />
</p>

```

See all the options here https://www.postgresql.org/docs/current/app-psql.html

<a name="command-copydb"/>

## Command: ``copydb``

**Prerequites:** init

```
odoo-openupgrade-wizard copydb
    --source DB_NAME
    --dest NEW_DB_NAME
```

Create an Odoo database by copying an existing one.

This script copies using postgres CREATEDB WITH TEMPLATE. It also copies
the filestore.

<a name="command-dropdb"/>

## Command: ``dropdb``

**Prerequites:** init

```
odoo-openupgrade-wizard dropdb
    --database DB_NAME
```

Delete an Odoo database and its filestore.

This command will always success even if DB_NAME does not exists.

<a name="command-dumpdb"/>

## Command: ``dumpdb``

**Prerequites:** init

```
odoo-openupgrade-wizard dumpdb
    --database DB_NAME
    --database-path DATABASE_PATH
    --filestore-path FILESTORE_PATH
```

Dump the database DB_NAME to DATABASE_PATH and export the filestore
related to DB_NAME into FILESTORE_PATH. To choose the format of the
backup files look at the `--database-format` and `--filestore-format`.

*WARNING*: DATABASE_PATH should be a sub directory of the project path
in orter to have the postgresql container able to write the dump file.
For example, the project path is `/path/to/myproject` (where you run the
`init` command), then DATABASE_PATH can be any of the subdirectory of
`/path/to/myproject`.

**Optional arguments**

* To chose the database format use `--database-format`. Format can be
  one of the following:
      - `p` for plain sql text
      - `c` for custom compressed backup of `pg_dump`
      - `d` for directory structure
      - `t` for a tar version of the directory structure
  See also https://www.postgresql.org/docs/current/app-pgdump.html
  The default database format is `c`.

* To chose the filestore format use `--filestore-format`. Format can be
  one of the following:
      - `d` copy of the directory structure
      - `t` tar version of the directory structure (not compressed)
      - `tgz` tar version of the directory structure compressed with gzip.
  The default filestore format is `tgz`.

* By default, if database file or filestore file already exists, the
  command will fail, preserving the existing dump. If you need to
  overwrite the existing files, the `--force` option can be used.

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/odoo-openupgrade-wizard/odoo-openupgrade-wizard",
    "name": "odoo-openupgrade-wizard",
    "maintainer": "Sylvain LE GAL",
    "docs_url": null,
    "requires_python": "<4.0.0,>=3.9",
    "maintainer_email": null,
    "keywords": "cli, odoo, openupgrade",
    "author": "GRAP, Groupement R\u00e9gional Alimentaire de Proximit\u00e9",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/46/69/80d4f34083e758bc42be0321a4e4e6e8d9066e98870722f088a98f580a79/odoo_openupgrade_wizard-0.7.0.tar.gz",
    "platform": null,
    "description": "[![Gitlab CI](https://gitlab.com/odoo-openupgrade-wizard/odoo-openupgrade-wizard/badges/main/pipeline.svg)](https://gitlab.com/odoo-openupgrade-wizard/odoo-openupgrade-wizard/-/pipelines)\n[![codecov](https://gitlab.com/odoo-openupgrade-wizard/odoo-openupgrade-wizard/badges/main/coverage.svg)](https://gitlab.com/odoo-openupgrade-wizard/odoo-openupgrade-wizard/)\n[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)\n\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/odoo-openupgrade-wizard)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/odoo-openupgrade-wizard)\n![GitLab last commit](https://img.shields.io/gitlab/last-commit/34780558)\n![GitLab stars](https://img.shields.io/gitlab/stars/34780558?style=social)\n\n# odoo-openupgrade-wizard\n\nOdoo Openupgrade Wizard is a tool that helps developpers to make major\nupgrade of Odoo Community Edition. (formely OpenERP).\nIt works with Openupgrade OCA tools. (https://github.com/oca/openupgrade)\n\nthis tool is useful for complex migrations:\n- migrate several versions\n- take advantage of the migration to install / uninstall modules\n- execute sql requests or odoo shell scripts between each migration\n- analyse workload\n\nIt will create a migration environment (with all the code available)\nand provides helpers to run (and replay) migrations until it works.\n\n* To develop and contribute to the library, refer to the ``DEVELOP.md`` file.\n* Refer to the ``ROADMAP.md`` file to see the current limitation, bugs, and task to do.\n* See authors in the ``CONTRIBUTORS.md`` file.\n\n# Table of Contents\n\n* [Installation](#installation)\n* [Usage](#usage)\n    * [Command ``init``](#command-init)\n    * [Command ``pull-submodule``](#command-pull-submodule)\n    * [Command ``get-code``](#command-get-code)\n    * [Command ``docker-build``](#command-docker-build)\n    * [Command ``run`` (BETA)](#command-run)\n    * [Command ``install-from-csv``](#command-install-from-csv)\n    * [Command ``upgrade`` (BETA)](#command-upgrade)\n    * [Command ``generate-module-analysis`` (BETA)](#command-generate-module-analysis)\n    * [Command ``estimate-workload`` (BETA)](#command-estimate-workload)\n    * [Command ``psql``](#command-psql)\n    * [Command ``copydb``](#command-copydb)\n    * [Command ``dropdb``](#command-dropdb)\n    * [Command ``dumpdb``](#command-dumpdb)\n\n<a name=\"installation\"/>\n\n# Installation\n\n**Prerequites:**\n\n* The tools run on debian system\n* You should have docker installed on your system\n* Some features require extra packages. To have all the features available run:\n\n**Installation:**\n\nThe library is available on [PyPI](https://pypi.org/project/odoo-openupgrade-wizard/).\n\nTo install it simply run :\n\n``pipx install odoo-openupgrade-wizard``\n\n(See alternative installation in ``DEVELOP.md`` file.)\n\n<a name=\"usage\"/>\n\n# Usage\n\n**Note:**\n\nthe term ``odoo-openupgrade-wizard`` can be replaced by ``oow``\nin all the command lines below.\n\n<a name=\"command-init\"/>\n\n## Command: ``init``\n\n```\nodoo-openupgrade-wizard init\\\n  --initial-version=10.0\\\n  --final-version=12.0\\\n  --project-name=my-customer-10-12\\\n  --extra-repository=OCA/web,OCA/server-tools\n```\n\nInitialize a folder to make a migration from a 10.0 and a 12.0 database.\nThis will generate the following structure :\n\n```\nfilestore/\nlog/\n    2022_03_25__23_12_41__init.log\n    ...\npostgres_data/\nscripts/\n    step_1__update__10.0/\n        pre-migration.sql\n        post-migration.py\n    step_2__upgrade__11.0/\n        ...\n    step_3__upgrade__12.0/\n        ...\n    step_4__update__12.0/\n        ...\nsrc/\n    env_10.0/\n        extra_debian_requirements.txt\n        Dockerfile\n        odoo.conf\n        extra_python_requirements.txt\n        repos.yml\n        src/\n    env_11.0/\n        ...\n    env_12.0/\n        ...\nconfig.yml\nmodules.csv\n```\n\n* ``config.yml`` is the main configuration file of your project.\n\n* ``modules.csv`` file is an optional file. You can fill it with the list\n  of your modules installed on your production. The first column of this\n  file should contain the technical name of the module.\n\n* ``log`` folder will contains all the log of the ``odoo-openupgrade-wizard``\n  and the logs of the odoo instance that will be executed.\n\n* ``filestore`` folder will contains the filestore of the odoo database(s)\n\n* ``postgres_data`` folder will be used by postgres docker image to store\n  database.\n\n* ``scripts`` folder contains a folder per migration step. In each step folder:\n  - ``pre-migration.sql`` can contains extra SQL queries you want to execute\n    before beginning the step.\n  - ``post-migration.py`` can contains extra python command to execute\n    after the execution of the step.\n    Script will be executed with ``odoo shell`` command. All the ORM is available\n    via the ``env`` variable.\n\n* ``src`` folder contains a folder per Odoo version. In each environment folder:\n\n    - ``repos.yml`` enumerates the list of the repositories to use to run the odoo instance.\n      The syntax should respect the ``gitaggregate`` command.\n      (See : https://pypi.org/project/git-aggregator/)\n      Repo files are pre-generated. You can update them with your custom settings.\n      (custom branches, extra PRs, git shallow options, etc...)\n\n    - ``extra_python_requirements.txt`` enumerates the list of extra python librairies\n      required to run the odoo instance.\n      The syntax should respect the ``pip install -r`` command.\n      (See : https://pip.pypa.io/en/stable/reference/requirements-file-format/)\n\n    - ``extra_debian_requirements.txt`` enumerates the list of extra system librairies\n      required to run the odoo instance.\n\n    - ``odoo.conf`` file. Add here extra configuration required for your custom modules.\n      the classical keys (``db_host``, ``db_port``, etc...) are automatically\n      autogenerated.\n\nAt this step, you should change the autogenerated files.\nYou can use default files, if you have a very simple odoo instance without custom code,\nextra repositories, or dependencies...\n\n**Note:**\n\n- In your repos.yml, preserve ``openupgrade`` and ``server-tools`` repositories\n  to have all the features of the librairies available.\n- In your repos.yml file, the odoo project should be in ``./src/odoo``\n  and the openupgrade project should be in ``./src/openupgrade/`` folder.\n\n<a name=\"command-pull-submodule\"/>\n\n## Command: ``pull-submodule``\n\n**Prerequites:** init\n\nif you already have a repos.yml file on github / gitlab, it can be convenient to\nsynchronize the repository, instead of copy past the ``repos.yml`` manually.\n\nIn that case, you can add extra values, in the ``config.yml`` file in the section\n\n```\nodoo_version_settings:\n  12.0:\n      repo_url: url_of_the_repo_that_contains_a_repos_yml_file\n      repo_branch: 12.0\n      repo_file_path: repos.yml\n```\n\nthen run following command :\n\n```\nodoo-openupgrade-wizard pull-submodule\n```\n\n<a name=\"command-get-code\"/>\n\n## Command: ``get-code``\n\n**Prerequites:** init\n\n```\nodoo-openupgrade-wizard get-code\n```\n\nThis command will simply get all the Odoo code required to run all the steps\nfor your migration with the ``gitaggregate`` tools.\n\nThe code is defined in the ``repos.yml`` of each environment folders. (or in the\ndirectory ``repo_submodule`` if you use ``pull-submodule`` feature.)\n\n**Note**\n\n* This step could take a big while !\n\n**Optional arguments**\n\nif you want to update the code of some given versions, you can provide an extra parameter:\n\n```\nodoo-openupgrade-wizard get-code --versions 10.0,11.0\n```\n\n<a name=\"command-docker-build\"/>\n\n## Command: ``docker-build``\n\n**Prerequites:** init + get-code\n\nThis will build local docker images that will be used in the following steps.\n\nAt this end of this step executing the following command should show a docker image per version.\n\n\n```\n$ docker images --filter \"reference=odoo-openupgrade-wizard-*\"\n\nREPOSITORY                                                 TAG       IMAGE ID       CREATED       SIZE\nodoo-openupgrade-wizard-image---my-customer-10-12---12.0   latest    ef664c366208   2 weeks ago   1.39GB\nodoo-openupgrade-wizard-image---my-customer-10-12---11.0   latest    24e283fe4ae4   2 weeks ago   1.16GB\nodoo-openupgrade-wizard-image---my-customer-10-12---10.0   latest    9d94dce2bd4e   2 weeks ago   924MB\n```\n\n**Optional arguments**\n\n* if you want to (re)build an image for some given versions, you can provide\n  an extra parameter: ``--versions 10.0,12.0``\n\n**Note**\n\n* This step could take a big while also !\n\n\n<a name=\"command-run\"/>\n\n## Command: ``run`` (BETA)\n\n**Prerequites:** init + get-code + build\n\n```\nodoo-openupgrade-wizard run\\\n    --step 1\\\n    --database DB_NAME\n```\n\nRun an Odoo instance with the environment defined by the step argument.\n\nThe database will be created, if it doesn't exists.\n\nif ``stop-after-init`` is disabled, the odoo instance will be available\nat your host, at the following url : http://localhost:9069\n(Port depends on your ``host_odoo_xmlrpc_port`` setting of your ``config.yml`` file)\n\n**Optional arguments**\n\n* You can add ``--init-modules=purchase,sale`` to install modules.\n\n* You can add ``stop-after-init`` flag to turn off the process at the end\n  of the installation.\n\n\n<a name=\"command-install-from-csv\"/>\n\n## Command: ``install-from-csv``\n\n**Prerequites:** init + get-code + build\n\n```\nodoo-openupgrade-wizard install-from-csv\\\n    --database DB_NAME\n```\n\nInstall the list of the modules defined in your ``modules.csv`` files on the\ngiven database.\n\nThe database will be created, if it doesn't exists.\n\nTo get a correct ``modules.csv`` file, the following query can be used:\n```\npsql -c \"copy (select name, shortdesc from ir_module_module where state = 'installed' order by 1) to stdout csv\" coopiteasy\n```\n\n\n<a name=\"command-upgrade\"/>\n\n## Command: ``upgrade`` (BETA)\n\n**Prerequites:** init + get-code + build\n\n```\nodoo-openupgrade-wizard upgrade\\\n    --database DB_NAME\n```\n\nRealize an upgrade of the database from the initial version to\nthe final version, following the different steps.\n\nFor each step, it will :\n\n1. Execute the ``pre-migration.sql`` of the step.\n2. Realize an \"update all\" (in an upgrade or update context)\n3. Execute the scripts via XML-RPC (via ``odoorpc``) defined in\n   the ``post-migration.py`` file.\n\n**Optional arguments**\n\n* You can add ``--first-step=2`` to start at the second step.\n\n* You can add ``--last-step=3`` to end at the third step.\n\n\n<a name=\"command-generate-module-analysis\"/>\n\n## Command: ``generate-module-analysis`` (BETA)\n\n**Prerequites:** init + get-code + build\n\n```\nodoo-openupgrade-wizard generate-module-analysis\\\n    --database DB_NAME\n    --step 2\n    --modules MODULE_LIST\n```\n\nRealize an analyze between the target version (in parameter via the step argument)\nand the previous version. It will generate analysis_file.txt files present\nin OpenUpgrade project.\nYou can also use this fonction to analyze differences for custom / OCA modules\nbetween several versions, in case of refactoring.\n\n<a name=\"command-estimate-workload\"/>\n\n## Command: ``estimate-workload``\n\n**Prerequites:** init + get-code\n\n```\nodoo-openupgrade-wizard estimate-workload\n```\n\nGenerate an HTML file name ``analysis.html`` with all the information regarding\nthe work to do for the migration.\n- checks that the modules are present in each version. (by managing the\n  renaming or merging of modules)\n- check that the analysis and migration have been done for the official\n  modules present in odoo/odoo\n\n<a name=\"command-psql\"/>\n\n## Command: ``psql``\n\n**Prerequites:** init\n\n```\nodoo-openupgrade-wizard psql\n    --database DB_NAME\n    --command \"SQL_REQUEST\"\n```\n\nExecute an SQL Request on the target database.\n\n**Optional arguments**\n\n* If no ``database`` is provided, default ``postgres`` database will be used. exemple:\n\n```\nodoo-openupgrade-wizard psql --command \"\\l\";\n```\nResult:\n```\n                              List of databases\n    Name    | Owner | Encoding |  Collate   |   Ctype    | Access privileges\n------------+-------+----------+------------+------------+-------------------\n postgres   | odoo  | UTF8     | en_US.utf8 | en_US.utf8 |\n template0  | odoo  | UTF8     | en_US.utf8 | en_US.utf8 | =c/odoo          +\n            |       |          |            |            | odoo=CTc/odoo\n template1  | odoo  | UTF8     | en_US.utf8 | en_US.utf8 | =c/odoo          +\n            |       |          |            |            | odoo=CTc/odoo\n test_psql  | odoo  | UTF8     | en_US.utf8 | en_US.utf8 |\n\n```\n\n* if you execute request that return long result, you can choose to select ``pager`` or ``-no-pager``\n  option to display the result via the click function ``echo_via_pager``.\n  (see : https://click.palletsprojects.com/en/8.1.x/utils/#pager-support)\n\nNote : Pager is enabled by default.\n\n\n* you can pass extra psql arguments inline.\n\n```\nodoo-openupgrade-wizard psql\n    --database=test_psql\n    --command \"select id, name from res_partner where name ilike '%admin%';\"\n    -H\n```\nResult:\n```\n<table border=\"1\">\n  <tr>\n    <th align=\"center\">id</th>\n    <th align=\"center\">name</th>\n  </tr>\n  <tr valign=\"top\">\n    <td align=\"right\">3</td>\n    <td align=\"left\">Administrator</td>\n  </tr>\n</table>\n<p>(1 row)<br />\n</p>\n\n```\n\nSee all the options here https://www.postgresql.org/docs/current/app-psql.html\n\n<a name=\"command-copydb\"/>\n\n## Command: ``copydb``\n\n**Prerequites:** init\n\n```\nodoo-openupgrade-wizard copydb\n    --source DB_NAME\n    --dest NEW_DB_NAME\n```\n\nCreate an Odoo database by copying an existing one.\n\nThis script copies using postgres CREATEDB WITH TEMPLATE. It also copies\nthe filestore.\n\n<a name=\"command-dropdb\"/>\n\n## Command: ``dropdb``\n\n**Prerequites:** init\n\n```\nodoo-openupgrade-wizard dropdb\n    --database DB_NAME\n```\n\nDelete an Odoo database and its filestore.\n\nThis command will always success even if DB_NAME does not exists.\n\n<a name=\"command-dumpdb\"/>\n\n## Command: ``dumpdb``\n\n**Prerequites:** init\n\n```\nodoo-openupgrade-wizard dumpdb\n    --database DB_NAME\n    --database-path DATABASE_PATH\n    --filestore-path FILESTORE_PATH\n```\n\nDump the database DB_NAME to DATABASE_PATH and export the filestore\nrelated to DB_NAME into FILESTORE_PATH. To choose the format of the\nbackup files look at the `--database-format` and `--filestore-format`.\n\n*WARNING*: DATABASE_PATH should be a sub directory of the project path\nin orter to have the postgresql container able to write the dump file.\nFor example, the project path is `/path/to/myproject` (where you run the\n`init` command), then DATABASE_PATH can be any of the subdirectory of\n`/path/to/myproject`.\n\n**Optional arguments**\n\n* To chose the database format use `--database-format`. Format can be\n  one of the following:\n      - `p` for plain sql text\n      - `c` for custom compressed backup of `pg_dump`\n      - `d` for directory structure\n      - `t` for a tar version of the directory structure\n  See also https://www.postgresql.org/docs/current/app-pgdump.html\n  The default database format is `c`.\n\n* To chose the filestore format use `--filestore-format`. Format can be\n  one of the following:\n      - `d` copy of the directory structure\n      - `t` tar version of the directory structure (not compressed)\n      - `tgz` tar version of the directory structure compressed with gzip.\n  The default filestore format is `tgz`.\n\n* By default, if database file or filestore file already exists, the\n  command will fail, preserving the existing dump. If you need to\n  overwrite the existing files, the `--force` option can be used.\n",
    "bugtrack_url": null,
    "license": "AGPLv3+",
    "summary": "CLI tool to manage Odoo Major Upgrades",
    "version": "0.7.0",
    "project_urls": {
        "Homepage": "https://gitlab.com/odoo-openupgrade-wizard/odoo-openupgrade-wizard",
        "Repository": "https://gitlab.com/odoo-openupgrade-wizard/odoo-openupgrade-wizard"
    },
    "split_keywords": [
        "cli",
        " odoo",
        " openupgrade"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e505813a735ba9154959ae31e82e480662eca092ba9059ed25bc4117e60bbe2f",
                "md5": "1d12e35334d8cca138f3ac77a0e042b7",
                "sha256": "5ea2d0301df0dd39912e7fa65cd9af66d5e82699cf4a3cebc616aaff05d8b880"
            },
            "downloads": -1,
            "filename": "odoo_openupgrade_wizard-0.7.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1d12e35334d8cca138f3ac77a0e042b7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0.0,>=3.9",
            "size": 54753,
            "upload_time": "2024-05-02T21:56:51",
            "upload_time_iso_8601": "2024-05-02T21:56:51.583800Z",
            "url": "https://files.pythonhosted.org/packages/e5/05/813a735ba9154959ae31e82e480662eca092ba9059ed25bc4117e60bbe2f/odoo_openupgrade_wizard-0.7.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "466980d4f34083e758bc42be0321a4e4e6e8d9066e98870722f088a98f580a79",
                "md5": "71b2ed5be3079657e739c20e0d800185",
                "sha256": "b5c5bb0c923c8e8f5ed2f8cde8afed91e58f433baf9f30b2bdf819a7ce183b8a"
            },
            "downloads": -1,
            "filename": "odoo_openupgrade_wizard-0.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "71b2ed5be3079657e739c20e0d800185",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0.0,>=3.9",
            "size": 42080,
            "upload_time": "2024-05-02T21:56:53",
            "upload_time_iso_8601": "2024-05-02T21:56:53.593316Z",
            "url": "https://files.pythonhosted.org/packages/46/69/80d4f34083e758bc42be0321a4e4e6e8d9066e98870722f088a98f580a79/odoo_openupgrade_wizard-0.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-02 21:56:53",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "odoo-openupgrade-wizard",
    "gitlab_project": "odoo-openupgrade-wizard",
    "lcname": "odoo-openupgrade-wizard"
}
        
Elapsed time: 0.25313s