Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upgrade airflow?

Tags:

airflow

There seems to be no proper documentation about upgrading airflow. The Upgrading Airflow to a newer version page only talks about upgrading the database. So what is the proper way of upgrading airflow?

Is it just upgrading the python packages to the newest versions? Or should I use the same venv and install the newer airflow version completely from scratch? Or is it something else altogether?

I'm guessing doing the database upgrade would be the final step followed by one of these steps.

like image 725
Pradyumna Avatar asked Oct 17 '25 00:10

Pradyumna


2 Answers

Adding to Vivian's answer - I had installed airflow from PyPi and was upgrading from 2.2.4 to 2.3.0.

To upgrade airflow,

  1. I installed the new version of airflow in the same virtual environment as 2.2.4 (using this).

  2. Upgraded the database using airflow db upgrade. More details here.

  3. You might have to manually upgrade providers using pip install packagename -U

After this, when I started Airflow, I got an error related to some missing conf. Airflow wanted the newest version of airflow.cfg, but I had the older version. To fix this,

  1. Renamed my airflow.cfg to airflowbackup.cfg. This is done so that airflow will make a new airflow.cfg on start up when it sees that there is no config file.
  2. Compared airflowbackup.cfg with the 2.2.4 config to find out all the fields I had changed.
  3. Manually made those same changes in the newly made airflow.cfg

For Helm installations - update the helm chart to the newer version if present, update the airflow version in the chart and apply it.

like image 111
Pradyumna Avatar answered Oct 19 '25 14:10

Pradyumna


I was also struggling with upgrading airflow for minor versions and didn't feel like I found a good answer in the docs. I think I have the right approach after looking back at how I installed airflow in the first place.

  • If you followed the guide to run airflow locally you'll want to change the value for AIRFLOW_VERSION in the commands to your desired version.

  • If you followed the guide to run airflow on docker, then you'll want to fetch the latest docker-compose.yaml. The command on the site always has the latest version. Then re-run docker compose up.

You can confirm you have the right version by running airflow version. I run airflow via docker so the docker steps work for me, I imagine the local steps should be about the same.

like image 34
Viv Avatar answered Oct 19 '25 13:10

Viv



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!