Easy way to migrate editor built questions to a different schema

Hey Community!

Long story short, we have a few different warehouse environments to support development. These are represented as different schemas in the same database. We build a number of reports built using the metabase editor that are pointing to our staging schema that we are happy with, but now we need to migrate them to our production schema.

My problem is that I want an easy way in the editor to point an editor-built question from staging_dw.table to prod_dw.table and I can’t seem to figure out a way to do that easily without rebuilding the report from scratch (when i change a table, it drops all things below it in the editor). I also want to keep the question as an “editor built” question and do not want to convert it to a SQL question.

Is there any trick to doing this easily (or at least easier than rebuilding the question)? Hopefully I’m just missing something obvious.

Thanks!

Hi @pvolk1
Everything in the Metabase application database is based on IDs, so it can be difficult to make such changes.

It’s possible to do a lot with Serialization, but that’s an Enterprise Edition function.

If you don’t have any questions on prod_dw, then you could remove those tables and rename the schema of staging_dw - you would do that in the application database table metabase_table.
If you have prod data you want to preserve, then you would have modify the IDs in report_card (and probably other places), so it pointed to tables with the schema prod_dw.

It’s not going to be easy, and if you manually mess with the application database, then make sure you got backups first.

You might want to upvote this issue:
https://github.com/metabase/metabase/issues/6496 - upvote by clicking :+1: on the first post

Thanks for the thorough reply! We’ll just end up going with manually rebuilding them in this case. Added a +1 to the linked issue.