Copy dashboards and questions from one server to another

I’ll answer my own question!

First, there’s no ‘proper’ way to do this.
Second, it can be tricky to maintain stuff like the database_id if you try and copy across.
Third, make sure you’re using a real database for your dashboards (I used MySQL).

Start of by making a copy of your customer’s database on your local server.
Have multiple bat files (I’m working in Windows) to start the jar, one for each customer.
Modify the database connection strings to work with your local database once running.

Do your work.

Now to transfer. You can create SQL scripts to move the new rows. I found it easier to use copy and paste from within MySQL Workbench, but that would depend upon you having access to both databases at once. If you’ve modified something rather than changing, you need to update the original row. Don’t delete then insert (I’m not sure if cascading deletes are enabled).

Questions are stored in the report_card table. Nice and easy to move.
Metrics are in metric
Metalayer stuff is in metabase_field. I think this is best modified on the customer’s server, or by just restoring your database over their existing one. There are 1000s of rows and it’s all updates rather than inserts.
Databases are in metabase_database, though I doubt there’s much stuff to modify in there.
Dimensions displayed via foreigh keys are in dimension
Segments are in segment
Dashboards are in report_dashboard and their contents in report_dashboardcard

Hopefully, someone will come along shortly and tell me there’s a MySQL utility that can copy changes across. I know there are similar for MS SQL.

7 Likes