GitHub user sowmyachitti edited a comment on the discussion: Issue with 
downgrade from 3.0.0 to 2.10.3

It's because the installation of apache-airflow 2.10.3 still fetching the 
0027_2_10_3_fix_dag_schedule_dataset_alias_reference_naming.py file into the 
python3.11/...../site_packages/airflow/migrations/versions  which has the 
function usage of mysql_foreign key but the    
python3.11/...../site_packages/airflow/migrations/utils.py doesn't have that 
package.....


If your only looking for db downgrade on priority without downgrading 
apache-airflow package to 2.10.3 the below code might help it will throw an 
exception but says downgrade complete

'''
airflow db downgrade --to-version 2.10.3 --yes

airflow db migrate
'''

Note : please take a backup of your airflow_home which will have airflow db and 
config file before this step for a safety side


----------------------------------


I'm not pretty sure with the solution how to downgrade the package itself along 
with db my trails dint work 🙁


Below I have tried

When my apache airflow was 3.0.0 I have given below command even though it 
threw an error in between saying ab_user table must be present along with fab 
manager it showed downgrade complete

'''
airflow db downgrade --to-version 2.10.3 --yes

airflow db migrate
'''

Before and after I have taken a backup of airflow home which has config file, 
airflow db and all then proceeded with uninstall of 3.0.0 and installed 2.10.3 
via pip and restored the airflow db via downgraded backup copy but ended up 
throwing same error ... could see pip install apache-airflow==2.10.3 was still 
showing those migrations.versions files which are of 3.0.0 ...... so have 
installed apache-airflow via GitHub tag then I could see files of 2.10.3 only 
and not the files of version issue files ... 

Later it started throwing errors of auth_manager variable of config file... 
could see one or other way the airflow db is getting corrupted or failed.... 
when package as well gets downgraded 





My final way as I'm stuck with high priority delivery...
Removed airflow_home files including airflow db as well airflow directory in 
the python site packages ....by taking a backup (probably once they reply with 
some solution I will use this backup) and uninstalled apache-airflow 3.0.0 and 
made a fresh installation of 2.10.1 and used a new db initialisation... 

GitHub link: 
https://github.com/apache/airflow/discussions/49722#discussioncomment-12971206

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to