Skip to content
Odoo Migration

Odoo Migration: Managing User Roles and Permissions Across Versions

A practical guide for CIOs and IT directors on migrating Odoo user roles, groups, and access rights. Learn how to audit, map, and validate permissions to prevent security breaches and operational disruptions during version upgrades.

9 min readSysGenPro Editorial
Odoo Migration: Managing User Roles and Permissions Across Versions

Direct Answer: Auditing and Mapping Permissions is Critical for Safe Odoo Migrations

Managing user roles and permissions during an Odoo migration requires a rigorous audit of existing access rights, a detailed mapping strategy to the target version, and comprehensive validation in a staging environment. Unlike standard data fields, security configurations are deeply embedded in the database schema and application logic. Relying on automatic migration tools without manual verification poses significant risks, including unauthorized data access, broken business processes, and compliance violations. The primary goal is to ensure that the principle of least privilege is maintained, that role hierarchies are preserved or intentionally redesigned, and that all record-level security rules function correctly in the new environment. This process is not merely a technical task but a governance exercise that protects sensitive business data and ensures operational continuity.

Phase 1: Comprehensive Security Audit and Baseline Establishment

Before initiating any technical migration steps, you must establish a complete baseline of the current security posture. This involves extracting all user accounts, groups, and access rules from the source Odoo instance. You need to identify which users are active, which are dormant, and which have administrative privileges. More importantly, you must document the specific access rights associated with each group. In Odoo, access is controlled by two main mechanisms: model access rights (ir.model.access) which define CRUD operations on models, and record rules (ir.rule) which filter data visibility based on user attributes or group membership.

Identifying Deprecated and Custom Groups

A critical part of the audit is identifying groups that may have been deprecated, renamed, or removed in the target Odoo version. Odoo frequently refines its standard group structure between major releases. For example, a group that previously granted broad access to sales reports might be split into more granular groups in a newer version. Additionally, custom modules often create custom groups that may depend on specific technical features that change across versions. You must cross-reference your custom groups against the official release notes and documentation for the target version to determine if they remain valid or require reimplementation. This step prevents the creation of orphaned permissions or, worse, unintended privilege escalation.

Mapping User Attributes to Security Rules

Record rules in Odoo often rely on user attributes such as company_id, department, or custom fields. If the target version changes how these attributes are stored or if the user model is modified, existing record rules may fail silently or behave unexpectedly. You must map every record rule to its dependent user attributes and verify that these attributes exist and are populated correctly in the target schema. This is particularly important for multi-company environments where data segregation is enforced through company-specific rules. Failure to validate these dependencies can lead to users seeing data from other companies or being unable to see their own data.

Phase 2: Strategic Mapping and Role Redesign

Once the baseline is established, the next step is to define the target state for user roles. This is an opportunity to clean up technical debt and align permissions with current business processes. Do not assume a one-to-one mapping is always optimal. Use this phase to consolidate redundant groups, remove unused permissions, and implement stricter access controls where necessary. Engage with business stakeholders to confirm that the proposed role structure meets their operational needs and compliance requirements.

Source GroupTarget GroupActionRationaleRisk Level
Sales Manager (Legacy)Sales Manager (Standard)MapStandard group exists in target versionLow
Custom: Finance AuditorCustom: Finance Auditor (Rebuilt)RecreateCustom group depends on deprecated moduleMedium
Admin (All Access)Admin (Restricted)RedesignReduce privilege scope for securityHigh
Dormant UsersInactiveDisableNo active business needLow

Document every decision made during this mapping phase. Create a migration matrix that links source groups to target groups, noting any changes in permissions. This document serves as the single source of truth for the technical team and the audit trail for compliance officers. It also facilitates communication with end-users who may experience changes in their access rights. For example, if a user previously had access to a specific report that is now restricted, they need to be informed in advance to avoid confusion and support tickets.

Phase 3: Technical Execution and Data Migration

The technical execution of the migration involves moving the user and permission data to the target database. This is typically done as part of the broader database migration process. However, security data requires special attention. Standard migration tools may not handle complex record rules or custom access rights correctly, especially if the underlying model structure has changed. You may need to write custom scripts to extract, transform, and load security configurations. These scripts must be idempotent and capable of handling conflicts if the target database already contains some standard groups.

Handling Custom Modules and Dependencies

Custom modules that define security rules must be updated to work with the target Odoo version. This often involves modifying Python code that defines access rights or record rules. You must ensure that these modules are installed in the correct order and that their dependencies are satisfied. If a custom module fails to install, it may leave the system in an inconsistent state where some permissions are missing. Therefore, it is crucial to test the installation of all custom modules in a staging environment before attempting the production migration. Verify that the security rules defined in the code match the intended access matrix.

Database Schema Changes and Compatibility

Odoo versions may introduce changes to the database schema that affect how security data is stored. For instance, the structure of the ir.model.access table might change, or new fields might be added to the res.users table. You must verify that your migration scripts account for these schema changes. Use the official Odoo documentation for the target version to understand any breaking changes in the security framework. If you are migrating across multiple major versions, you may need to perform intermediate upgrades to ensure compatibility. Always check the vendor's official documentation for the exact source and target versions to confirm support and compatibility.

Phase 4: Rigorous Validation and Testing

Validation is the most critical phase of the migration. You must test user permissions in a staging environment that mirrors the production setup. This includes testing with a representative sample of users from different roles and departments. Do not rely solely on automated tests; manual testing is essential to catch subtle issues that automated scripts may miss. Create test cases that cover normal access, denied access, and edge cases such as users with multiple group memberships.

  • Verify that users can access the modules and records they are supposed to see.
  • Confirm that users cannot access data or functions they are not authorized for.
  • Test record rules to ensure data segregation is working correctly.
  • Validate that administrative functions work as expected for IT staff.
  • Check for any security exceptions or errors in the logs during testing.

Use a combination of unit tests, integration tests, and user acceptance testing (UAT). Unit tests can verify that individual security rules are applied correctly. Integration tests can ensure that the interaction between different modules and security rules works as intended. UAT involves real users testing their access rights in the staging environment. Collect feedback from users and address any issues before proceeding to production. Document all test results and any defects found. This documentation is crucial for the go/no-go decision and for post-migration support.

Phase 5: Deployment and Cutover Planning

The deployment phase involves applying the migrated security configurations to the production environment. This should be done during a planned maintenance window to minimize disruption. Before cutover, ensure that you have a verified backup of the production database and a tested rollback plan. The rollback plan should include steps to restore the previous version of the database and revert any changes to user accounts and permissions. Communicate the cutover schedule to all stakeholders, including IT staff, business users, and support teams.

TaskResponsible RoleEstimated TimeDependencySuccess Criteria
Final Data LoadDBA2 hoursStaging Validation PassedData Integrity Check Passed
Security Config ApplyERP Admin1 hourData Load CompleteNo Security Errors in Logs
Smoke TestingQA Team1 hourSecurity Config AppliedCritical Users Can Log In
Go/No-Go DecisionProject Manager30 minsSmoke Testing PassedSign-off from Stakeholders

During cutover, monitor the system closely for any security-related errors or user complaints. Have a dedicated support team ready to assist users who may have issues with their access rights. If any critical issues are detected, trigger the rollback plan immediately. Do not attempt to fix complex security issues in production during the cutover window. It is better to roll back and resolve the issues in a staging environment than to risk data corruption or security breaches.

Phase 6: Post-Migration Stabilization and Monitoring

After the migration is complete, the system enters a stabilization period. During this time, continue to monitor the system for any security anomalies. Review the audit logs regularly to detect any unauthorized access attempts or unusual user behavior. Provide ongoing support to users who may have questions about their access rights. Collect feedback from users and make any necessary adjustments to the permission structure. This iterative process helps to refine the security model and ensure that it meets the evolving needs of the business.

Continuous Security Auditing

Establish a regular schedule for security audits to ensure that user permissions remain aligned with business roles. Over time, users may change roles, and permissions may drift if not managed proactively. Implement a process for reviewing and updating user access rights on a quarterly basis. This helps to maintain compliance with internal policies and external regulations. Use automated tools to generate reports on user access and identify any anomalies. These reports can be used to support internal audits and demonstrate compliance to regulators.

Documentation and Knowledge Transfer

Written by
SysGenPro Editorial

SysGenPro Editorial

Platform & solutions team

Practical guidance on ERP, AI automation, cloud deployment and enterprise transformation from the SysGenPro team.

Share this article
Continue learning
View all articles
Explore the platform

Where to go next

Browse the knowledge hub

See how SysGenPro fits your business

Discuss your workflows, modules and deployment options with our team.

Back to resources