[16.0][ADD] helpdesk_mgmt_import(_setup): Migration data from helpdesk EE to helpdesk CE #816
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Migration from Helpdesk EE to Helpdesk Management CE
This PR introduces a robust, two-phase migration toolkit to seamlessly transition data from the Odoo Enterprise Edition (EE)
helpdeskmodule to the Community Edition (CE)helpdesk_mgmtsuite of modules.The migration is handled by two distinct modules to ensure a clean and safe process:
helpdesk_mgmt_import_setup: This is the preparation module. Its primary role is to create a safe backup of the production data and prepare the environment. In thepre_init_hook, it clones all essentialhelpdeskEE tables, renaming them with anee_prefix (e.g.,helpdesk_ticketbecomesee_helpdesk_ticket). Critically, it also preserves the ticket communication history (mail.message,mail.followers,ir.attachment) by archiving them temporarily. Once the data is secured, the module proceeds to uninstall the original EEhelpdeskmodule, clearing out its models and logic to prevent conflicts with the newhelpdesk_mgmtmodules.helpdesk_mgmt_import: This is the execution module. Afterhelpdesk_mgmt_import_setuphas cleared the way, this module takes over. It reads from the backed-upee_tables and carefully migrates the data into the new CE models. The process is executed in a specific order to maintain relational integrity. It also handles the crucial step of re-associating the archived communication history with the newly created CE tickets, ensuring no data is lost.Data Mapping & Migration Strategy
The migration logic respects the differences between the EE and CE data structures and proceeds in the following order to correctly build relationships:
helpdesk.tag→helpdesk.ticket.tag): Migrates tags, handling potential duplicates.helpdesk.ticket.type→helpdesk.ticket.type): Migrates the core name of ticket types.helpdesk.team→helpdesk.ticket.team): Maps essential team data and re-links users.helpdesk.stage→helpdesk.ticket.stage): Migrates stages and reassigns them to the correct teams. Also includes a post-migration step to merge duplicate default stages (e.g., "New," "In Progress") created by both the import and the base module.helpdesk.sla→helpdesk.sla): Translates and migrates SLA policies.helpdesk.ticket→helpdesk.ticket): The final and largest step, where tickets are recreated using the mapping dictionaries (tag_id_map,team_id_map, etc.) generated in the previous steps.This structured approach ensures that all dependencies are respected, resulting in a clean and reliable data migration.
Recommended Configuration After Migration
Once the OCA modules are installed and the data has been migrated, several configuration steps are recommended to ensure a functional helpdesk workflow:
helpdesk.ticket.team- this is mandatory in OCA to allow users to be assigned to tickets.resource_calendar_idconfigured.Note:
openupgradelibas detailed in [FIX] openupgrade_merge_records: safely merge jsonb and serialized fields openupgradelib#425