Query builder is getting erased in UI when changing data source

Hi, I've searched github and discussions but didn't find anything similar to the issue my team is facing.

Currently we have 2 environments: development, production and respective collections for each of them (DEV_COLLECTION, PROD_COLLECTION) and 2 separate Snowflake connections for dev and prod respectively also. Developers are not supposed to have an access to production data and collection but they take part in creating questions and dashboards in DEV_COLLECTION. When questions are created by dev team, admins need to transfer them manually to PROD_COLLECTION and change data source from dev to prod data. Unluckily after changing data sources query builder steps of question are getting erased causing lots of additional work during transfer. Both prod and dev Snowflake databases have an identical schemas and tables structures as well as names. Latest metabase version (0.47.6) doesn't preserve the query builder steps. Are there ways to achieve desired functionality without creating scripts interacting with Metabase API? In advance, thanks for your response!

Hi! Thanks for the detailed description. This is something we’ve been thinking with the team for a while but it’s not yet there. The only way to do this now is via the API

1 Like

Thanks for the quick response! Should I create github issue regarding this functionality then or there is no needs?

The way we do this is to have a common name for the db connection, then just change the connection details in live. That does mean doing all the work in dev, then just publishing the whole lot to live which may not meet your needs.