Upgrade feature SH - odoo-ps/psbe-process GitHub Wiki

Upgrade feature SH

You can find the Upgrade feature on the navigation bar of the production and staging branches.
The purpose of this feature is to integrate Odoo SH and the Upgrade Service platform in the same pipeline, so we can work on them together.

Staging

The way to work on with the Upgrade feature on the staging environment is:

  • Create a new branch for the intended upgrade version and move it to the staging environment.
  • Go to the Upgrade tab in the staging branch.
  • Select the version you want to upgrade the database.
  • Starts the Upgrade process by clicking on the Test Upgrade button.
  • SH starts the Upgrade process consisting in 4 stages:
    • Uploading database: The latest database's daily backup is sent to the Upgrade Service platform for processing.
    • Upgrade process: The upgrade is processed on the Upgrade Service platform.
    • Downloading database: The upgraded database is transferred back to the Odoo.sh platform.
    • Waiting user commit...: In this stage, the upgraded database is restored and updated upon each commit made to the branch to provide an easier development iteration flow for custom migration scripts.

      Once this stage is reached, nothing happens right after (there's no notification or build triggered)
      You have to commit something to the branch for the new build to get created.

  • To stop using the feature on the branch, click on the Exit Upgrade mode.

IMPORTANT:

  • Only one branch can be in Upgrade Mode at a time (including staging and production environments).
  • Manual backups are ignored. Only the latest database's daily backup is taken into account.
  • Once you exit the Upgrade Mode, the behavior upon new commits of the branch is 'New build'.

Production

On the production environment the process is similar but triggered in a different way:

  • Go to the Upgrade tab in the production branch.

  • Select the version you want to upgrade the database.

  • Commit the upgraded code to the production branch. The commit triggers the process.
    To make the commit:

    • Create a PR from the staging into the main branch.
    • Check that everything looks fine.
    • Rebase and merge the PR.

    This way, the history of the commits done is preserved and you can track down changes in the code to their respective commits (which should include the ticket id with additional details about the issue/change).

  • SH starts the Upgrade process consisting in 6 stages:

    • Dumping database: A backup is created with the latest data of the database. The database becomes unavailable, it remains in maintenance mode until the process is complete.
    • Uploading database dump: The backup dump is sent to the upgrade platform.
    • Upgrade process: The upgrade is processed on the Upgrade Service platform.
    • Downloading database: The upgraded database is transferred back to the Odoo.sh platform.
    • Restoring dump: The upgraded database is restored.
    • Updating database: The new dump is restarted, which should trigger an update of your custom modules based on the version in their manifest.

SUMMARY:

  • In the Upgrade tab, select the new version and click "Start upgrade".
  • Commit the upgraded code.
  • Wait for SH and the upgrade platform to do everything.
  • Take a look at the upgraded database and let the customer know.
⚠️ **GitHub.com Fallback** ⚠️