Description
Description
We implemented this code to duplicate a Metabase collection and change the data source.
The downloaded data fom Metabase (via API) includes the following structure:
- collections
- collection 1
- collection 2
- collection 3
- cards
- dashboards
- collection 3
- collection 2
- collection 1
- snippets
The code successfully duplicates the following while changing the data source:
- cards
- the dashboard
- the collections
However, it does not duplicate dashboard tabs.
Environment
Metabase Version: v1.50.32
Ruby Version: 3.3.6
Steps to reproduce
Create a collection in metabase with:
- A collection that stores queries using field filters
- A dashboard with tabs and filters
Expected behavior
After importing the duplicated collection to Metabase, both the original and the duplicated dashboards should contain all tabs, with queries functioning as expected.
Actual behavior
After importing, the original dashboard appears without tabs, and queries fail.
Problem
We suspect this issue arises because the duplicated dashboards (which have unique IDs) are internally referencing the same tabs, a configuration Metabase may not support.
Possible solution
The clone.rb
script does not currently address tabs. Extending it to include tabs might resolve this issue.