It looks like you got unlucky with the timing of when you are doing this. 11 days ago there is a commit upgrading Discourse to using Rails 7. The import scripts use the ActiveRecord::Base.connection_config method which was removed with Rails 7.0.0rc1.
@loic It looks like the import scripts might have been missed when doing the upgrade.