Using the same question on another database

I’ve two instances of a web application, which both have the same DB schema.

I’ve a bunch of reports set up for one, and I’m wondering if I can somehow use metabase to get the same dashboards and reports for the second instance.

I don’t need inter-DB queries. These are just instances of the same app, each one with their own database.

I’m thinking of something functionally equivalent to passing a &database=secondOne to my views and seeing the same thing for the second DB (but that’s not an option).

Metabase doesn’t seem to have this out of the box, so I don’t really mind maybe having a script that creates duplicate dashboard and syncs the queries or something alike, but I’m not sure if that’s the cleanest solution.

Has anyone dealt with this? Is any feature alike on the roadmap? Any insight from those more experienced with metabase?

1 Like

Hi @WhyNotHugo
It is possible to do with Serialization in the Enterprise Edition with a little modification.
There’s a request open for switching databases, but that is going to be very difficult to implement given how the metadata is stored.
https://github.com/metabase/metabase/issues/6496 - upvote by clicking :+1: on the first post

Serialization seems to be related to having multiple metabase instances, and we don’t plan to have multiple metabase instances, that would be an overkill for us.

#6496 Seems to be spot on, I’ll subscribe to that and keep my fingers crossed!

If you don't to duplicate the questions/dashboards to check on a different database,
Simple way is to change the connection string to point to the new database hostname and db name etc, under "Metabase admin" -> "Databases" setting and click "Resync database Schema now" and/or "Rescan Field values". Vola, no change anywhere else in your "Question" or "SQL Query" or in the "Dashboard".