Introduction

Exporting Grafana dashboards allows you to share visualizations, back up configurations, or migrate between environments. Export failures can occur due to permission issues, API errors, or format problems. Understanding how to properly export dashboards and troubleshoot failures ensures you can reliably share and backup your monitoring configurations.

Symptoms

  • Export button shows "Failed to export dashboard" or no action
  • Exported JSON file is incomplete or missing panels
  • Error: "Permission denied" when attempting export
  • Exported dashboard references internal IDs that won't work in other Grafana instances
  • Export API returns 403 Forbidden or 500 Internal Server Error
  • Export includes sensitive data that shouldn't be shared

Common Causes

  • User lacks read permission on the dashboard
  • Dashboard has too many panels causing export timeout
  • API endpoint is blocked or misconfigured
  • Export format includes internal IDs instead of UIDs
  • Dashboard contains sensitive annotations or variables
  • Browser download is blocked by security settings

Step-by-Step Fix

Permission Issues

  1. 1.Check user permissions on the dashboard:
  2. 2.```bash
  3. 3.curl -s -u admin:password http://localhost:3000/api/dashboards/uid/dashboard-uid | jq '.meta | {canView: .canView, canSave: .canSave, canEdit: .canEdit}'
  4. 4.`
  5. 5.Verify user has at least Viewer role:
  6. 6.- Navigate to Configuration > Users
  7. 7.- Check user's organization role
  8. 8.- Check dashboard folder permissions
  9. 9.Grant export permissions:
  10. 10.```bash
  11. 11.curl -X POST -u admin:password \
  12. 12.-H "Content-Type: application/json" \
  13. 13.-d '{"userId": 2, "permission": 1}' \
  14. 14.http://localhost:3000/api/dashboards/uid/dashboard-uid/permissions
  15. 15.`

Export via UI

  1. 1.Standard export process:
  2. 2.- Open the dashboard you want to export
  3. 3.- Click the gear icon (Dashboard settings)
  4. 4.- Click "JSON Model" or "Export"
  5. 5.- Click "Copy to clipboard" or "Download JSON"
  6. 6.- Save the file
  7. 7.For sharing dashboards externally:
  8. 8.- Click "Share" > "Export"
  9. 9.- Enable "Export for external use"
  10. 10.- This removes internal IDs and uses datasource names instead of UIDs

Export via API

  1. 1.Export dashboard JSON via API:
  2. 2.```bash
  3. 3.curl -s -u admin:password \
  4. 4.http://localhost:3000/api/dashboards/uid/dashboard-uid | jq '.dashboard' > dashboard-export.json
  5. 5.`
  6. 6.Export all dashboards:
  7. 7.```bash
  8. 8.# List all dashboards
  9. 9.curl -s -u admin:password http://localhost:3000/api/search?type=dash-db | jq '.[] | .uid'

# Export each dashboard for uid in $(curl -s -u admin:password http://localhost:3000/api/search?type=dash-db | jq -r '.[] | .uid'); do curl -s -u admin:password http://localhost:3000/api/dashboards/uid/$uid | jq '.dashboard' > dashboard-${uid}.json done ```

  1. 1.Export dashboards in a folder:
  2. 2.```bash
  3. 3.curl -s -u admin:password "http://localhost:3000/api/search?type=dash-db&folderUid=folder-uid" | jq '.[] | .uid'
  4. 4.`

Export Format Issues

  1. 1.Check for problematic datasource references:
  2. 2.```bash
  3. 3.jq '.panels[] | .datasource' dashboard-export.json
  4. 4.`
  5. 5.Ensure datasource references use UIDs, not IDs:
  6. 6.```json
  7. 7.// Correct format
  8. 8."datasource": {
  9. 9."type": "prometheus",
  10. 10."uid": "prometheus-uid"
  11. 11.}

// Incorrect format (internal ID) "datasource": { "id": 1, "name": "Prometheus" } ```

  1. 1.Fix datasource references:
  2. 2.```bash
  3. 3.# Remove internal datasource IDs
  4. 4.jq 'walk(if type == "object" and has("datasource") then del(.datasource.id) else . end)' dashboard-export.json > dashboard-clean.json
  5. 5.`

Clean Export for Sharing

  1. 1.Remove sensitive data from export:
  2. 2.```bash
  3. 3.# Remove annotations that might contain sensitive data
  4. 4.jq 'del(.annotations.list)' dashboard-export.json > dashboard-clean.json

# Remove template variables with sensitive defaults jq 'del(.templating.list[].current)' dashboard-export.json > dashboard-clean.json ```

  1. 1.Prepare export for external Grafana:
  2. 2.- In the UI, use "Export for external use" option
  3. 3.- This converts datasource UIDs to names
  4. 4.- Removes internal Grafana references

Bulk Export Issues

  1. 1.For dashboards with many panels, increase API timeout:
  2. 2.```ini
  3. 3.# In grafana.ini
  4. 4.[server]
  5. 5.read_timeout = 60
  6. 6.write_timeout = 60
  7. 7.`
  8. 8.Export large dashboards via CLI or script:
  9. 9.```bash
  10. 10.# Use jq to extract just the dashboard definition
  11. 11.curl -s -u admin:password http://localhost:3000/api/dashboards/uid/$uid | \
  12. 12.jq '{dashboard: .dashboard, meta: {}}' > export.json
  13. 13.`

Export Provisioning Format

  1. 1.Export in provisioning-compatible format:
  2. 2.```json
  3. 3.{
  4. 4."apiVersion": 1,
  5. 5."dashboard": {
  6. 6.// dashboard JSON content
  7. 7.}
  8. 8.}
  9. 9.`
  10. 10.Create provisioning file:
  11. 11.```bash
  12. 12.curl -s -u admin:password http://localhost:3000/api/dashboards/uid/$uid | \
  13. 13.jq '{apiVersion: 1, dashboard: .dashboard}' > provisioning/dashboards/dashboard.json
  14. 14.`

Verification

  1. 1.Validate exported dashboard JSON:
  2. 2.```bash
  3. 3.python3 -c "import json; json.load(open('dashboard-export.json'))"
  4. 4.`
  5. 5.Verify dashboard structure is complete:
  6. 6.```bash
  7. 7.jq '.panels | length' dashboard-export.json
  8. 8.jq '.templating.list | length' dashboard-export.json
  9. 9.`
  10. 10.Test import in another Grafana instance:
  11. 11.- Import the exported JSON file
  12. 12.- Verify all panels load correctly
  13. 13.- Confirm datasource references are resolved
  14. 14.Check for sensitive data leaks:
  15. 15.```bash
  16. 16.grep -i "password|secret|token|key" dashboard-export.json
  17. 17.`

Prevention

To prevent dashboard export issues:

  1. 1.Establish export standards - Create a standardized process for dashboard exports including review steps for sensitive data removal.
  2. 2.Use datasource naming conventions - Establish consistent datasource names across environments to simplify datasource mapping during imports.
  3. 3.Automate exports - Set up automated daily exports of dashboards to version control for backup and disaster recovery:
  4. 4.```bash
  5. 5.# Daily export script
  6. 6.for uid in $(curl -s -u admin:password http://localhost:3000/api/search?type=dash-db | jq -r '.[] | .uid'); do
  7. 7.curl -s -u admin:password http://localhost:3000/api/dashboards/uid/$uid | jq '.dashboard' > dashboards/${uid}.json
  8. 8.done
  9. 9.`
  10. 10.Separate sensitive data - Keep sensitive annotations and variables in separate dashboards or use secure provisioning methods rather than embedding in export files.
  11. 11.Test export/import cycles - Periodically test the complete export and import cycle to ensure backups would work in a disaster scenario.
  12. 12.Document dashboard dependencies - For each dashboard, document which datasources and plugins it requires to simplify import troubleshooting.
  13. 13.Use provisioning for production - For production environments, use dashboard provisioning rather than manual exports and imports for consistency.
  14. 14.Review permissions regularly - Ensure users who need to export dashboards have appropriate permissions and that permission changes don't break export processes

Common Pitfalls

  • Exporting dashboards with internal IDs that break imports
  • Including sensitive annotation data in shared exports
  • Not validating JSON before attempting imports
  • Exporting from incompatible Grafana versions
  • Exporting dashboards with missing plugin dependencies
  • [WordPress troubleshooting: Fix IAM Timeout Error - Complete Trouble](fix-iam-timeout-error)
  • [Technical troubleshooting: Fix Cloudwatch Alarm Not Triggering Issue in Monit](cloudwatch-alarm-not-triggering)
  • [Fix Datadog Agent Not Sending Metrics Issue in Monitoring](datadog-agent-not-sending-metrics)
  • [Fix Elasticsearch Cluster Red Yellow Status Issue in Monitoring](elasticsearch-cluster-red-yellow-status)
  • [Fix Alertmanager Notification Failed](fix-alertmanager-notification-failed)

<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "TechArticle", "headline": "How to Fix Grafana Dashboard Export Error", "description": "Troubleshoot Grafana dashboard export errors including JSON generation failures, permission issues, and format compatibility problems.", "url": "https://www.fixwikihub.com/fix-grafana-dashboard-export", "publisher": { "@type": "Organization", "name": "FixWikiHub", "url": "https://www.fixwikihub.com" }, "author": { "@type": "Person", "name": "FixWikiHub Editorial Team" }, "datePublished": "2025-11-14T05:54:21.279Z", "dateModified": "2025-11-14T05:54:21.279Z" } </script>