docs/sources/as-code/observability-as-code/git-sync/export-resources.md
{{< admonition type="caution" >}}
Git Sync is now GA for Grafana Cloud, OSS and Enterprise. Refer to Usage and performance limitations to understand usage limits for the different tiers.
Contact Grafana for support or to report any issues you encounter and help us improve this feature.
{{< /admonition >}}
Traditional operations such as moving or copying a dashboard to a provisioned folder or bulk export are gradually being incorporated into Git Sync. In the meantime the following options are available:
You can save a copy of dashboard directly from the Grafana UI to your provisioned folder.
To do so, follow these steps:
main is not supported.You can also export an existing dashboard with the Grafana CLI. Use the CLI to download the resources you want to sync from Grafana, and then commit and push those files to your provisioned Git repository. Git Sync will then detect the commit, and synchronize with Grafana.
To do so, follow these steps:
grafanactl context to point to your instance as documented in Defining contexts.grafanactl resources pull dashboards --path <REPO_PATH>
Next, commit and push the resources to your Git repository:
git add <DASHBOARDS_PATH>
git commit -m "Add dashboards from Grafana"
git push
Where:
See more at Manage resources with Grafana CLI.
To add an existing dashboard to Git Sync via JSON export, you need to:
To export a dashboard as a JSON file it must follow this CRD structure:
{
'apiVersion': 'dashboard.grafana.app/v1',
'kind': 'Dashboard',
'metadata': { 'name': 'dcf2lve9akj8xsd' },
'spec': { /* Original dashboard JSON goes here */ },
}
The structure includes:
apiVersion: Specifies the API version (currently v1)kind: Identifies the resource type (Dashboard)metadata: Contains the dashboard identifier uid. You can find the identifier in the dahsboard's URL or in the exported JSONspec: Wraps your original dashboard JSONAfter you've saved a dashboard in Git, it'll be synchronized automatically, and you'll be able to work with it as any other provisioned resource. Refer to Work with provisioned dashboards for more information.