Lire cet article en français

The 67 municipalities that run their out-of-school childcare with iA·AES now work on Odoo 18, hosted on a completely renewed infrastructure. Behind this version change lie three projects carried out side by side: the code, the data and the hosting. And one goal, met: lose nothing along the way.

Why migrate?

iA·AES is built on Odoo, an open source business management suite (ERP). Odoo only maintains its three most recent versions: since Odoo 18 was released, version 15 is no longer supported. Staying on it meant going without security fixes and drifting further away from the ecosystem of free modules we rely on.

Migrating was therefore necessary. We turned it into an opportunity: since every instance had to be touched anyway, we also modernised the way they are hosted, deployed and backed up.

First movement: the code

When the application moved from version 9 to version 15, it was largely rewritten. This time we made the opposite choice: we adapted the 21 proven modules that make up iA·AES instead of rewriting them. The features municipal staff know stay the same; what changes is the foundation underneath.

Adapting rather than rewriting was no walk in the park, though. The iA·AES development team took the code straight from Odoo 15 to Odoo 18, without stopping at the versions in between. Yet over three major versions, Odoo had profoundly changed its rules. Its web interface was rewritten, the way screens and their display conditions are described changed twice, and entire functions the code relied on disappeared. All 21 modules had to be brought in line with these new rules, without changing anything that already worked!

This adaptation also builds on the work of the Odoo Community Association (OCA), which brings Odoo developers and integrators together around shared free modules. Rather than building everything ourselves, we reuse its building blocks, which have proven their worth: file storage, login sessions, configuration and first-name/last-name handling for contacts.

For the curious — Pooling resources does not stop at municipalities. By relying on modules maintained by a whole community, iMio also shares the maintenance effort with other Odoo users around the world. That is what free software is about.

Second movement: the data

Adapting the code is not enough: each municipality has its own database, holding years of enrolments, attendance records, invoices and documents. That database had to be brought from Odoo 15 to Odoo 18 without losing a single row.

The first hurdle: unlike the code, a database cannot jump straight from version 15 to version 18. It is migrated one major version at a time — 15 to 16, then 16 to 17, then 17 to 18. The second hurdle: the community edition of Odoo ships no official tool for these migration steps.

This is where OpenUpgrade comes in: the OCA project that maintains, version after version, the migration scripts for Odoo’s standard modules. Without it, we would have had to write the transformation of every table in the Odoo core ourselves, at every step. With it, we could focus our effort on what is specific to iA·AES.

From Odoo 15 to S3 · three version hops, then the file transfer

The database moves through the versions one at a time; the files only leave for S3 once the database has reached version 18 and been checked.

For the curious — Each step runs in a frozen environment, built once and never touched again, so that two trial runs give exactly the same result. In versions 16 and 17, iA·AES exists only as empty shells: modules stripped down to their skeleton, just enough to carry the data through that stage, since nobody ever wrote iA·AES for those versions. The last step runs in two passes: first with OpenUpgrade, then without it, using exactly the iA·AES code that runs in production. If the database loads under those conditions, that proves it is genuinely usable, not just by an Odoo propped up by migration tools.

Our rule: count before, count again after. Before starting, the migration process records everything it can — record counts, business rules, installed modules, attachments. It counts again after each step. At the slightest discrepancy that was not explained in advance, it stops rather than carrying on “just in case”.

But counting does not tell the whole story. At each step, Odoo also writes a log several thousand lines long, containing many warnings. Most of them are harmless; still, we have to be sure. Nobody reads this log by hand: the migration process checks every warning automatically. Each one must match a rule we wrote in advance, which points to the ticket where that case was analysed and judged safe. A warning that matches no rule blocks the migration: someone then has to work out where it comes from, then write the missing rule or fix the process. A municipality’s migration is only signed off with zero blocking errors and zero unexplained warnings.

Before the migration, we rehearsed it in-house on the data of all 67 municipalities: first on anonymised copies, then on real copies in a fully isolated environment. No email could leave it, and every copy was destroyed at the end of the run. The outcome: 67 municipalities migrated without errors!

The database itself migrates in two to four minutes per municipality. One finding surprised us: the duration depends not on the amount of data but on the number of installed modules. A database four times larger can migrate twice as fast as another.

Third movement: the infrastructure

Before this migration, iA·AES instances were spread across several virtual machines. All of them now run on a modern platform, shared with other iMio applications.

This change brings several guarantees:

  • greater resilience to failures: if a server goes down, the application restarts on its own on another one, with no intervention; the database is continuously copied to a replica, ready to take over;
  • files kept safe: documents, certificates and invoices no longer depend on any single server, and each municipality has its own space, isolated from the others;
  • safer updates: every new version is tested automatically before it reaches any municipality, and can be rolled back as easily as it was installed;
  • configuration under control: every setting is written down, tracked and reversible, and the platform corrects any drift on its own.

For the curious — The instances run on Kubernetes, a platform that orchestrates applications as containers. Their configuration is described in a Git repository, which the platform applies continuously. Every code change produces an image that is checked automatically, then deployed to a dedicated test environment; deploying a new version comes down to changing a version number in a file. The database runs on a replicated PostgreSQL cluster, with a primary instance and a replica. Attachments have left the servers’ local disks for S3 object storage, with a separate space for each municipality: the application no longer keeps anything on its own disk and can be restarted, moved or scaled out with no risk to the files.

Moving the attachments to their new storage space was by far the longest part of the migration. Where the database migrates in a few minutes, moving and checking one by one the files of a municipality, sometimes several gigabytes of them, takes much longer. This transfer is what set the pace of the migrations.

Migration nights

The migration took place overnight, server by server and municipality by municipality. Before touching anything, the process took a verified backup of each municipality, which allowed a return to the previous state. A municipality that ran into a problem did not prevent the next ones from migrating.

The following morning, each instance was first opened internally to be checked, then handed back to the municipalities. Teams found iA·AES at the usual address. Emails queued at the time of the cut-off went out as normal, and none was sent by mistake during the migration.

What it changes

For municipalities and their staff:

  • an application on a maintained version of Odoo, with its security fixes;
  • the interface and performance of Odoo 18;
  • improvements delivered faster, because they are better tested upstream.

For iMio:

  • a uniform fleet, deployed and monitored in the same way for every municipality;
  • infrastructure shared with other iMio applications already hosted on Kubernetes;
  • a sound base for future Odoo versions, with a migration method now well proven.

Thank you

This migration is the result of teamwork at iMio: the iA·AES team, Thomas from the Dev team and Alexandre from the DevOps team, who wrote this article. Thanks also to the OCA community, without whom OpenUpgrade would not exist. We took the time to do it right: that is the best service we can offer the teams who use iA·AES every day.