Migrate all questions to a different database

I couldn’t find this answered previously, sorry if this question is a repeat.
Right now some of our questions are using DatabaseX and others DatabaseY. I want to switch them all to use DatabaseY without going through each one by hand. Some were created using the query builder tool, others in raw sql.

I’m pretty sure the only way to do ‘bulk query changes’ is through metabase local database.

I just need to check which table stores the queries, so you’d have to change them, but I personally think It’s kinda risky and would prefer spending a few hours doing it manually.

Hi @dfine

If all your queries were SQL, then it would be fairly easy to change them by modifying the database ID of dataset_query in the table report_card of your metadata.

But since it also involves the query builder questions, which are linked to tables and fields defined in metabase_table/metabase_field, then it’s a lot more complicated, since those references most likely are using different IDs for tables/fields.

Depending on how many queries you have, it might be easier just to manually change each question via the interface.