migrating-airflow-2-to-3

Migrate Apache Airflow 2.x projects to Airflow 3.x using Ruff AIR rules.

2|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/miptah21/skills --skill migrating-airflow-2-to-3-miptah21
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrating-airflow-2-to-3
Source: https://github.com/miptah21/skills/tree/main/.agents/skills/migrating-airflow-2-to-3
Command: npx skills add https://github.com/miptah21/skills --skill migrating-airflow-2-to-3-miptah21

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill reduces the risk and effort of upgrading Apache Airflow 2.x DAGs to Airflow 3.x by identifying breaking changes in imports, operators, context keys, scheduling semantics, and metadata access patterns.

Core Features & Use Cases

  • Upgrade guidance with guardrails: Recommends upgrading Airflow 2.11 first and stresses safer rollback constraints before moving to Airflow 3.
  • Automated detection & fixing: Guides running Ruff with Airflow-specific rule sets (AIR30/AIR301/AIR302/AIR31/AIR311/AIR312) to auto-fix common breakages.
  • Production-aware migration patterns: Covers Airflow 3 runtime restrictions such as removal of direct ORM/metadata DB access and provides replacement approaches using the Airflow Python client or REST API.
  • Migration checklist & targeted search patterns: Helps you scan for legacy imports, removed/renamed DAG arguments, deprecated context keys, XCom pickling changes, and Datasets→Assets migration.
  • Use Case: When you have an Airflow 2 codebase with legacy operators/hooks and DAGs relying on execution_date and direct ORM session queries, use this to modernize the codebase for Airflow 3 runtime constraints and API changes.

Quick Start

Ask the AI to migrate your Airflow 2 project to Airflow 3 using Ruff AIR rules and then generate a checklist of remaining issues to manually review.

Frequently Asked Questions about migrating-airflow-2-to-3

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate Airflow 2 DAGs to Airflow 3 without breaking changes?

To migrate Airflow 2 DAGs to Airflow 3, you need to fix breaking changes across legacy imports, execution_date context usage, direct ORM session queries, and deprecated APIs. A systematic upgrade plan involves running Ruff with Airflow-specific rules and manually refactoring metadata access to use the REST API.

What breaking changes do I need to fix for an Airflow 3 migration?

Airflow 3 migration requires addressing removed and renamed DAG arguments, deprecated context keys, XCom pickling changes, and Datasets to Assets migration. You must also replace direct ORM and metadata DB access with the Airflow Python client or REST API due to new runtime restrictions.

Can I automatically fix Airflow 2 to 3 migration issues using Ruff?

Yes, you can automatically fix common Airflow 2 to 3 migration breakages by running Ruff with specific Airflow rule sets including AIR30, AIR301, AIR302, AIR31, AIR311, and AIR312. These rules target legacy operators and outdated code patterns for automated upgrades.

How do I handle direct metadata DB access when upgrading to Airflow 3?

When upgrading to Airflow 3, direct ORM and metadata DB access is restricted and must be refactored. You should replace direct ORM session queries and metadata database interactions by using replacement approaches like the Airflow Python client or the REST API.

Do I need to upgrade to Airflow 2.11 before migrating to Airflow 3?

Yes, upgrading to Airflow 2.11 first is recommended before migrating to Airflow 3. This intermediate upgrade provides safer rollback constraints and helps ensure a smoother transition when modernizing your codebase for Airflow 3 runtime restrictions.

What is the best way to scan for deprecated context keys and legacy imports in Airflow 2?

The best way to scan for deprecated context keys, legacy imports, and old scheduling defaults in Airflow 2 is to use a targeted migration checklist. This helps identify XCom pickling changes and Datasets to Assets migration requirements before upgrading to Airflow 3.