# Odoo Migration Debugging

> Odoo Migration XML Debugging

- Skill: `amirreza-km/odoo-migration-debugging` (Agent Skill)
- Install (CLI): `npx skillmds@latest add amirreza-km/odoo-migration-debugging`
- Raw SKILL.md: https://api.skillmd.com/api/skills/amirreza-km/odoo-migration-debugging/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: amirreza-km (https://skillmd.com/u/amirreza-km)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/amirreza-km/odoo-migration-debugging

---

# Odoo Migration XML Debugging

## Description
A procedure for debugging failed Odoo OpenUpgrade migrations related to XML ID references.

## When to use
When OpenUpgrade migration fails because of XML references or missing external IDs.

## Requirements
- Access to the OpenUpgrade source code.
- PSQL access to the database.

## Procedure
1. Check XML IDs using `select * from ir_model_data where name = '...';`
2. Compare old and new records in the source and destination versions.
3. Fix references by manually updating `noupdate` flags or deleting orphaned `ir_model_data`.
4. Test migration locally.

## Examples
If an old view was removed:
```sql
DELETE FROM ir_model_data WHERE model = 'ir.ui.view' AND name = 'view_old_feature';
```

## Common mistakes / Pitfalls
Avoid deleting XML IDs blindly. Always backup the database first.

