Migration Workflow¶
This guide explains the complete AAP migration process.
The source instance may be Ansible Automation Platform (AAP) or upstream AWX.
When using AWX, configure SOURCE__VERSION to the equivalent AAP release level
(only AWX 24.6.1 has been tested). See
AWX Migration for the version mapping.
Overview¶
AAP Bridge follows an ETL (Export, Transform, Load) pattern:
┌──────────┐ ┌──────────┐ ┌───────────┐ ┌────────┐ ┌──────────┐
│ Prep │──▶│ Export │──▶│ Transform │──▶│ Import │──▶│ Validate │
└──────────┘ └──────────┘ └───────────┘ └────────┘ └──────────┘
Phase 1: Preparation¶
Purpose: Analyze both AAP instances and prepare for migration.
What happens:
- Connects to source AAP and fetches API schema
- Connects to target AAP and fetches API schema
- Compares schemas to identify field differences
- Generates transformation rules
- Saves prep data for subsequent phases
Output:
prep/source_schema.json- Source AAP schemaprep/target_schema.json- Target AAP schemaprep/schema_comparison.json- Field differences and transformations
Phase 2: Export¶
Purpose: Extract all resources from source AAP.
What happens:
- Exports resources in dependency order
- Handles pagination automatically
- Splits large datasets into multiple files
- Tracks export progress in state database
Export Order:
| Order | Resources | Notes |
|---|---|---|
| 1 | Organizations | Foundation resource |
| 2 | Labels | |
| 3 | Credential Types | |
| 4 | Credentials | |
| 5 | Credential Input Sources | |
| 6 | Execution Environments | Default platform EEs are skipped by default |
| 7 | Projects | |
| 8 | Inventories | Smart and constructed inventories exported separately |
| 9 | Inventory Sources | Includes cloud/SCM source configuration |
| 10 | Constructed Inventories | |
| 11 | Inventory Groups | Includes nested group hierarchy |
| 12 | Hosts | Dynamic hosts skipped by default |
| 13 | Notification Templates | |
| 14 | Job Templates | Includes survey spec and notification associations |
| 15 | Workflow Job Templates | Includes nodes, survey spec, and notification associations |
| 16 | System Job Templates | |
| 17 | Schedules | System-job schedules excluded |
| 18 | Users | |
| 19 | Teams | |
| 20 | Role Definitions | AAP 2.5+ RBAC custom role definitions |
| 21 | User Role Assignments | |
| 22 | Team Role Assignments |
Output Structure:
exports/
├── metadata.json
├── organizations/
│ └── organizations_0001.json
├── inventories/
│ ├── inventories_0001.json
│ └── inventories_0002.json
└── hosts/
├── hosts_0001.json
├── hosts_0002.json
└── hosts_0003.json
Phase 3: Transform¶
Purpose: Apply schema transformations for target AAP version.
What happens:
- Reads exported data
- Applies field mappings from schema comparison
- Removes deprecated fields
- Adds new required fields with defaults
- Validates transformed data
Transformations applied:
- Field renames (e.g., API changes between versions)
- Type conversions
- Default value injection for new required fields
- Removal of read-only fields
Phase 4: Import¶
Purpose: Load transformed data into target AAP.
What happens:
- Creates resources in dependency order
- Resolves foreign key references using ID mappings
- Uses bulk APIs where available (hosts)
- Handles conflicts (already exists)
- Tracks progress and creates checkpoints
Import Features:
- Bulk Operations: Hosts imported 200 at a time via the AAP bulk API
- Host-Group Associations: Hosts are associated with their groups after bulk import
- Inventory Source Sync: After importing inventory sources, the tool triggers a sync and waits for completion before moving to constructed and smart inventories
- Smart Inventory Deferral: Smart inventories are imported in a dedicated phase after inventory source sync to ensure correct host membership
- Survey Specs: Job template and workflow job template survey specs are posted after template creation
- Notification Associations: Notification template relationships (started/success/error/approvals) are applied after template creation
- Nested Groups: Inventory group parent-child relationships are recreated after all groups are imported
- Classic RBAC Translation: On legacy sources (AAP ≤2.4), user and team role grants from
users/{id}/roles/andteams/{id}/roles/are converted torole_user_assignmentsandrole_team_assignmentson AAP 2.5+ targets. AAP 2.5+ sources export the new assignment APIs directly - Idempotency: Skips already-migrated resources
- Conflict Resolution: Updates or skips existing resources
- Checkpointing: Can resume from any failure point
Phase 5: Validation¶
Purpose: Verify migration success.
What happens:
- Compares resource counts between source and target
- Validates field values match
- Checks relationship integrity
- Generates validation report
Checkpoint and Resume¶
Automatic Checkpoints¶
Checkpoints are created automatically during import:
- After each resource type completes
- At configurable intervals within large batches
Viewing Checkpoints¶
Resuming from Failure¶
# Resume from last checkpoint
aap-bridge migrate resume
# Resume from specific checkpoint
aap-bridge migrate resume --checkpoint inventories_batch_50
Resource Dependencies¶
Understanding dependencies is crucial for migration:
Organizations
├── Users (member of)
│ └── Team memberships
├── Teams (belongs to)
│ └── Resource role grants
├── Credentials (owned by)
├── Projects (belongs to)
└── Inventories (belongs to)
├── Inventory Sources → sync → Smart Inventories
├── Inventory Groups (with nested hierarchy)
│ └── Hosts (associated after bulk import)
└── Constructed Inventories (after inventory source sync)
Credential Types (standalone)
└── Credentials (uses)
└── Credential Input Sources
Execution Environments (standalone)
Notification Templates (org-scoped)
Job Templates
├── Project (uses)
├── Inventory (uses)
├── Credentials (uses)
├── Execution Environment (uses)
├── Survey Spec (sub-resource)
└── Notification Associations (started/success/error)
Workflow Job Templates
├── Nodes (embedded, including approval templates)
├── Survey Spec (sub-resource)
└── Notification Associations (started/success/error/approvals)
Role Definitions (AAP 2.5+ RBAC)
├── Role User Assignments
└── Role Team Assignments
Best Practices¶
Before Migration¶
- Backup target AAP - Always have a rollback plan
- Test in staging - Run migration in a test environment first
- Check disk space - Exports can be large
- Verify credentials - Source API token has read-only scope with permission to read all resources being migrated; target API token has read/write scope with admin-level access to create and modify resources
During Migration¶
- Monitor progress - Watch for errors in logs
- Don't interrupt bulk operations - Wait for completion
- Use checkpoints - Resume rather than restart on failure
After Migration¶
- Validate thoroughly - Run validation phase
- Test functionality - Run sample job templates
- Check RBAC - Verify user permissions
- Update credentials - Encrypted values need manual setup
Troubleshooting¶
See Troubleshooting Guide for common issues and solutions.