Grafana backup and restore

Back up a self-hosted Grafana so you can rebuild it: the database, configuration, plugins, provisioning files in Git, and a restore you have actually tested. Scoped to infrastructure you control.

On this page

Why Grafana backup and restore needs its own plan

A shared Grafana holds dashboards, data source definitions, users, teams, alert rules and server settings that other teams rely on every day, and most of that state lives outside the Grafana binary. A usable Grafana backup is several artifacts, not one file: the configuration database that stores dashboards and users, the configuration and plugin folders on disk, and any provisioning or as-code files that describe data sources, dashboards and alerting resources. A restore needs all of them. A database dump without the plugin folder can bring back dashboards that point at plugins the new server does not have, and a provisioning repository that was never backed up can leave you with a database that Grafana later overwrites from an outdated copy.

The metadata database choice decides how you take the database copy. Grafana stores configuration in SQLite 3 by default, MySQL 8.0 or later, or PostgreSQL 12 or later, and the installation docs say SQLite does not scale for production. Confirm which database your instance uses before you write any backup procedure, because a file copy of a SQLite database, a logical dump from MySQL and a dump from PostgreSQL are different operations with different consistency guarantees. Check the database settings in the [database] section of grafana.ini and the environment variables that override them, since the file on disk may not reflect what a container actually uses.

Teams usually need this plan at three points: before a shared instance goes into production use, before a Grafana upgrade, and when an audit or internal recovery requirement asks for evidence that the instance can be rebuilt. Upgrades are the most common trigger, since a major release changes what a restore can expect. Grafana's upgrade guidance describes major releases once a year and minor releases every other month, so a recovery point taken before each upgrade is cheap insurance. For audit purposes, the backup procedure, its schedule and the restore test results are the evidence reviewers will ask for. Ask your team which recovery point and recovery time objectives apply to Grafana, because the answers set how often the database is dumped and how the restore is tested.

Which backup artifact covers which Grafana state

This table maps each part of a self-hosted Grafana to the artifact that captures it, with the situations where each fits. Read it to find the gaps: anything created only through the UI lives in the database and is lost unless the database is backed up.

ArtifactWhat it holdsWhen it fitsTrade-off
Database dump (SQLite file, MySQL or PostgreSQL)Dashboards, folders, users, teams, data source records, alert rules, annotations and preferences created in the UI or APIAlways needed as the baseline, because it is the only copy of UI-created stateCaptures everything but includes user and secret data, so it needs encryption and restricted access; a dump is only consistent if taken from a stopped or quiesced database
Data directory (/var/lib/grafana)Plugins installed from the catalog, the default SQLite file when used, and other runtime filesKeeps installed plugins and any local SQLite state when the database is not externalPlugins can be reinstalled from their sources, so this is most useful for offline or air-gapped plugin copies; it does not hold dashboards on an external database
Configuration file (grafana.ini or environment overrides)Server settings, database connection, authentication settings, and pathsNeeded to rebuild the same behavior and to record hardening choicesOften holds database passwords and OAuth client secrets; store them in a secrets manager or reference environment variables instead of plain text in backups
Provisioning YAML or JSON filesData sources, dashboards, plugin settings and alerting resources defined as files loaded at startupBest for resources that should be reproducible and reviewed, such as core data sources and standard dashboardsProvisioned resources can be edited in the UI only when allowed; changes made in the UI may not be reflected in the file, so verify sync direction before relying on files alone
Terraform or Git Sync sourcesInfrastructure-as-code definitions of dashboards, folders and other resources kept in a version-controlled repositoryFits teams that review changes and need history, rollback and a record of who changed whatThe repository is only as complete as the resources managed through it; dashboards built by hand and not exported remain uncovered, and state files need their own protection

What a rebuildable Grafana backup must contain

A rebuildable backup of Grafana has to capture two kinds of state, and they live in different places. The first is state held in the database: users, teams, folders, dashboards created in the UI, alert rules created in the UI, preferences and the data source definitions added through the interface. The second is state held in files: the grafana.ini configuration file, the provisioning directories that define data sources, dashboards and alerting resources at startup, and the plugin folder. A dump of the database without the files, or the files without the database, produces an instance that starts but is missing part of its working state. SQLite is the default store, but the installation docs describe it as unsuitable for production, so a production or high availability instance runs on MySQL or PostgreSQL. Confirm which database your instance uses before you design the backup, because the dump tooling, retention and restore steps differ for each.

Some of what Grafana stores is encrypted with a secret key, and that key is the part teams most often forget. Credentials for data sources and other stored secrets are encrypted in the database using the key configured in the server settings. A database dump restored without the matching key leaves those credentials unreadable, so every data source login would have to be re-entered by hand. Store the secret key in a separate, access-controlled location, record which key version matches which backup set, and keep it out of the same storage bucket as the database dump. Also confirm how your deployment supplies the key, whether through the configuration file, an environment variable or an external secret store, because each changes where the key must be backed up.

Provisioning files belong in Git, not only in the backup archive, because they are the reviewable definition of the instance. Keep the provisioning directories, the grafana.ini file with secrets removed, and the plugin list under version control, and treat the backup archive as the copy of runtime state that Git does not hold. Before you finalize the scope, list each item in one table with its location, owner, backup method and the restore test that proves it works. Items that are not in the table will be missing when you need them.

Setting up backups and a restore order

This sequence turns a running Grafana into something you can rebuild: every artifact is inventoried, its source of truth is captured in Git or a dump, copies live off the primary host, and a documented restore order is proven on a scratch environment before you rely on it.

  1. Inventory every Grafana artifact and its location

    Start by listing everything a rebuild needs: the database backend and its connection settings, the grafana.ini file and environment overrides, the data directory, the plugins directory, the provisioning directory, the encryption or secret key material, TLS certificates, and any reverse proxy or load balancer configuration. For each item, record the host or service it lives on, who owns it, and whether it is recreated from code or only exists on disk. Done means a single inventory document that a second engineer can read and point to every artifact without asking you where it is.

  2. Move provisioning and as-code sources into Git

    Data sources, dashboards, plugin declarations and alerting resources defined in provisioning YAML or JSON files should be committed to a Git repository, so the files can be reloaded at startup on a new instance. Dashboards created only in the UI are not covered by this step, so decide per dashboard whether it is exported into the repository or accepted as a database-only asset. Confirm the check by reviewing the repository and starting a scratch Grafana that loads the provisioning directory with no other input. Done means the scratch instance shows the provisioned data sources and dashboards without manual edits.

  3. Schedule consistent database dumps

    Grafana keeps users, teams, dashboards, folders and most operational state in its database, which should be MySQL or PostgreSQL for production. Schedule a logical dump with the native tool for your engine, run it on a fixed schedule, and avoid overlapping jobs. Stop or quiet writes if your tooling requires it, or use a snapshot method that gives a consistent point in time. The dump should be taken from a replica or maintenance window where possible, since Grafana writes during normal use. Done means each run produces a dated file, and the job logs show success and a non-zero size.

  4. Verify each dump restores into a scratch database

    A dump that has never been loaded is not a backup. After each scheduled run, or at least on a regular test cadence you set, restore the latest file into an empty scratch database on a separate host, then start a Grafana instance against it and log in. Check that dashboard count, data source count, folder count and user count match the source within the expected change window. Record the command and outcome. Done means the scratch restore completes without errors and the check results are stored with the backup record.

  5. Copy configuration, plugins and secrets alongside the dump

    Copy the Grafana configuration file, the plugins directory, the provisioning directory and the secret key material that encrypts data source credentials, using a method that preserves file permissions and ownership. Note the Grafana version and the installed plugin versions in the same record, because a restore must match them. Store the secret key material separately from the database dump, with restricted access. Done means a restore inventory lists the exact Grafana version, the plugin list and checksums for the copied files.

  6. Store encrypted copies off the primary host

    Send dumps and file archives to storage that is separate from the Grafana host, such as a second network zone, object storage or an offline medium, and encrypt them before they leave the primary system. Separate access so that the Grafana administrators cannot silently delete the only copy, and keep a retention policy written down. Confirm the check by retrieving one archive from the off-host location and running the scratch restore from it. Done means at least one off-host copy has been restored successfully and the retention settings are recorded.

  7. Document and rehearse the restore order

    Write the restore runbook in this order: restore the database and retrieve the secret key material first, because data source credentials cannot be read without it; then restore the configuration file and environment variables; then restore plugins and confirm their versions match the record; then point provisioning at the restored Git checkout; and finally start Grafana and run start-up checks. Start-up checks include the health endpoint, logging in as an administrator, opening a provisioned dashboard, and running one query per data source. Rehearse the runbook on a scratch environment and record the time and any gaps. Done means a second engineer has completed the restore from the runbook alone and signed off the checks.

Protecting backup data and restore paths

A Grafana backup holds dashboards, data source credentials, user records and the secret key that protects them, so it is as sensitive as the running instance. The cards below cover where backups live, who can reach them, how long they are kept and what must travel with them. Check each one against your own backup design before the first backup runs.

Encrypt backups at rest and in transit

Grafana's database dump, configuration folder and provisioning files can expose data source passwords and API tokens to anyone who reads them. Encrypt backup files before they leave the Grafana host, and use encrypted connections when they move across the network to storage. Confirm who holds the encryption keys and whether a restore can be performed without the person who created the backup.

Store backups away from the Grafana host

A backup stored on the same server or volume as Grafana is lost in the same failure that takes Grafana down. Keep at least one copy in a separate system, such as object storage in another account, a second site or offline media. CIS Safeguard 11.4 asks for an isolated copy of recovery data, so confirm that the separate copy cannot be altered by the account that runs Grafana.

Separate backup administrators from users

Anyone who can read backups can read every secret inside them, so access must be narrower than Grafana admin access. The Essential Eight at maturity level 3 expects that backup administrators cannot modify or delete backups during retention, and that ordinary accounts cannot read backups, including their own. Write these rules into the access model and test them with a non-admin account.

Set retention periods per backup type

Retention determines how far back you can restore and how long old secrets remain in storage. Set separate periods for daily database dumps, weekly full copies and provisioning history, and agree them with the owners of the dashboards and alerting. Write the periods into the backup policy and confirm that deletion is automatic, logged and does not depend on one administrator.

Protect the secret key and database credentials

Grafana uses a secret key to encrypt stored data source credentials, so a database dump restored without that key leaves those secrets unreadable or unusable. Back up the secret key separately from the database dump, store it in a secrets manager and record which key matches which backup. Database credentials in the configuration file need the same protection as the dump itself.

Control access to restore paths

A restore path is a privileged action that can overwrite production data, so the people allowed to run it should be fewer than those who can view backups. Require a second approver for restores into production, log every restore and keep the restore runbook in a location the operators can reach during an incident. Confirm how these steps interact with your SSO and admin mapping before an outage occurs.

How to test that a restored Grafana actually works

How do I test that a restored Grafana actually works?

Restore the database backup and the configuration, provisioning files and plugin folders into a separate scratch environment, start Grafana there, and check each function a user or alert depends on. A restore is only proven when the instance starts cleanly against the restored database and the checks below pass. Keep the scratch instance off production networks and disable outbound notifications so a test does not send real alerts or write to live data sources.

  • Confirm that users can sign in through the same identity provider or local accounts.
  • Confirm each data source connects and returns data for a known time range.
  • Open representative dashboards and confirm panels render with expected values.
  • Confirm provisioned data sources, dashboards and alert rules load at startup.
  • Confirm alert rules evaluate and their states change as expected.
What should a Grafana restore test check first?

Start with the startup logs and the database, because every later check depends on Grafana opening its database cleanly. Look for migration errors, missing plugin warnings and provisioning failures in the log output. Then check that the restored database version matches the Grafana version that created the backup, since an unexpected schema mismatch will stop the instance before any user-facing test can run.

How do I confirm provisioned resources load after a restore?

Provisioned data sources, dashboards, plugins and alerting resources are defined in YAML or JSON files loaded at startup, so the restore test should compare the running instance with the files in Git. Confirm that every provisioned data source appears and that dashboards from provisioning files are present with their expected folders. Grafana documents further as-code options, including Terraform and Git Sync, which you can use to reconcile differences found during the test.

How often should a Grafana backup restore be tested?

Test on a fixed schedule and after any substantive change, such as a Grafana minor or major upgrade, a database move or a change to authentication. For organizations in scope of DORA, Article 11(6) requires ICT response and recovery plans to be tested at least yearly and after substantive changes, including switchovers to backups and redundant capacity, for entities other than microenterprises. Your own risk policy and internal audit may require more frequent tests, so confirm the schedule with your compliance owner.

Does DORA require Grafana restore tests to be documented?

DORA expects tests to be run and their outcomes recorded as part of the recovery plan, so each test should leave evidence. Record the date, the backup set used, the Grafana and database versions, the checks performed, the results and any follow-up actions. DeployOpen prepares systems, controls and evidence for compliance assessments, but auditors and certification bodies issue the assessment outcome, so ask your assessor which evidence format they expect.

Who should run a Grafana restore test?

The test should be run by someone who did not perform the backup, using the documented restore procedure, so gaps in the runbook surface. Operations engineers usually run the technical checks, while service owners confirm dashboards and alerts reflect current responsibilities. Ask whether your internal team has time to run the test in a separate environment, and whether a partner will run it under a written scope with agreed deliverables.

What does a restore test cost, and what drives it?

The main costs are staff time, a scratch environment with compute and storage, and access to test copies of data sources. Cost rises with the number of data sources, the number of dashboards and alert rules, the number of identity integrations to verify, and how much of the restore is manual. Costs are typically one-time for the first test design and recurring for each scheduled run. Ask any partner for a quote that separates test design, execution, evidence and remediation.

Limits to confirm in your environment

A backup plan for Grafana is only as good as the assumptions behind it. The items below are the points where a restore can quietly fail, and each one needs a check against your own database version, Grafana version, plugins and recovery targets before the plan is trusted.

Backup tooling and database version

Confirm that your backup tool supports the exact PostgreSQL or MySQL version Grafana uses, including the minor release and any engine-specific options. Your database team should also confirm which major versions are still within vendor support, because a dump taken on an unsupported engine may be hard to restore later. Ask the database owner to test a restore on a server running the same version as production, not a newer one.

Schema changes on restore

Grafana runs database migrations when it starts. Restoring a database dump into an older or newer Grafana binary can trigger a schema change, or refuse to start if the schema does not match the binary. Confirm the Grafana version recorded in your backup manifest, and test whether restoring it into the target version migrates cleanly before you depend on that path during an incident.

Plugin version compatibility

Plugin folders can be restored byte for byte and still fail after the restore, because a plugin may require a specific Grafana version or may have been updated since the backup was taken. Check the plugin versions in the backup against the Grafana version you will restore to, and confirm that any unsigned or privately built plugins are included in your backup scope and can be rebuilt if their files are lost.

State stored outside your database

Some Grafana Enterprise and Grafana Cloud features keep state in places a database dump does not reach, such as external identity provider mappings, Cloud-hosted stacks or SCIM-provisioned users. Confirm with your Grafana account team which features you use, where their state lives, and how each is recovered. Also check whether any on-disk encryption key or image rendering setting is needed to read restored secrets.

Restore time objective

Your business sets how long Grafana may be unavailable after a loss and how much recent configuration may be lost. Agree those targets with the owners of the systems Grafana monitors before you choose backup frequency and tooling, because a daily dump and a rebuilt-from-Git plan produce very different recovery windows. Write the target down and measure it in a restore test rather than assuming it.

Compliance and retention requirements

Frameworks such as DORA and the CIS Controls expect a documented recovery process, backups that are tested and protected, and an isolated copy of recovery data. Confirm with your compliance lead which requirements apply to your Grafana, including how long backups must be kept, where they may be stored, and who may access or delete them. Your auditor, not DeployOpen, decides whether your evidence is sufficient.

Database dump methods for PostgreSQL and MySQL backends

The database holds nearly everything Grafana needs to be rebuilt, including users, teams, folders, dashboards, data source definitions and alert state, so the dump method you choose decides whether a restore is consistent. For a PostgreSQL backend (version 12 or later, as the Grafana installation docs require for production), take a logical dump with pg_dump from a single snapshot so tables are captured at the same point, and keep a separate copy of the grafana.ini settings, because the database does not hold the secret_key that encrypts stored data source credentials. For a MySQL 8.0 or later backend, use mysqldump with --single-transaction on InnoDB tables so the dump reads a consistent view without locking writes. Confirm the flags with your database version and test them against your own schema before you rely on them. PostgreSQL also offers continuous archiving with a base backup and WAL segments, which enables point-in-time recovery to a chosen moment, as described in the PostgreSQL continuous archiving documentation. This matters when a bad dashboard deletion or alert change happens between nightly dumps. A hot standby or replica does not replace a backup: it faithfully replicates a DROP or a bad update, and its failover tooling is not a recovery point. PostgreSQL 14 support ends November 12, 2026, so if your Grafana database runs on it, plan the upgrade now and make sure the restore target runs a supported major version (currently 15 through 18 per the PostgreSQL versioning policy). Restoring a dump into an older major version than the one that produced it is a common source of failed restores, so rehearse the exact version pairing. For MySQL, Enterprise Backup is a commercial product from Oracle that performs hot physical backups, and it is one option if your organization already licenses MySQL Enterprise Edition. MySQL Community Edition has no equivalent bundled tool, so your runbook must document the logical dump approach, the flags, the storage location, the encryption of the dump file and the restore command. Ask your database team to confirm which MySQL track (LTS or Innovation) you run and whether the restore host uses the same major version, since dump files are not guaranteed to load cleanly across versions without checks.

Grafana backup and restore questions buyers ask

What does a Grafana backup and restore engagement cost?

The cost depends on the scope agreed in writing before work starts, and DeployOpen does not publish a price list, so a quote follows from that scope. The main cost drivers are the number of Grafana instances, the database engine and where it runs (SQLite, MySQL or PostgreSQL), how many plugins and provisioning files need capturing, where backups are stored and how restores are tested. One-time work covers the backup design, scripts or jobs, the restore runbook and the first full restore test. Recurring work covers monitoring backup jobs, periodic restore tests and changes after Grafana upgrades. Ask any quote to separate these two groups and to state which database engine and storage target it assumes.

How long does a first Grafana backup setup take?

Duration follows scope rather than a fixed figure, so the honest answer is that it grows with the number of instances, the database engine and the number of restore paths you need to prove. A single instance with a managed PostgreSQL or MySQL database and provisioning already in Git is a much smaller piece of work than several instances with plugin folders, custom storage and a documented recovery process. Your team should confirm the target recovery scenarios first, since those decide the test effort. The written scope sets the timeline for your engagement.

What does our team need to provide for a Grafana backup project?

Expect to provide access to the Grafana servers and the database host, a list of instances and their deployment method (package, container or Helm chart), and the location of any provisioning files and dashboards already stored in Git. You will also need to name the storage target for backups, the retention you need, and who approves restore tests. Access to a non-production environment for restore testing is important, because a backup is only proven when a separate instance comes up and shows the expected dashboards, data sources and users. Confirm these items with your security team before scope is agreed.

Can our internal team set up Grafana backups without a partner?

Yes, many teams can, provided they have someone comfortable with the database engine, Linux administration and secret handling. The skills that matter most are dumping and restoring the Grafana database, capturing configuration and plugin folders, keeping provisioning files in version control and running a clean restore on a second host. The harder parts are often the unwritten ones: defining recovery priorities, protecting backup data and proving the restore works under time pressure. Ask whether your team has capacity to run restore tests on a schedule, because that recurring work is where internal efforts usually slip.

How often should we test a Grafana restore?

Test often enough to match your recovery requirements and any framework you are assessed against. The CIS Controls v8.1 Safeguard 11.1 asks for a documented recovery process reviewed annually, and DORA Article 11(6) requires ICT response and recovery plans to be tested at least yearly and after substantive changes, which applies to financial entities. Beyond those reference points, retest after every Grafana major upgrade, a change to the database engine, a new plugin or a change in the storage target. A restore test should bring up a separate instance, check dashboards, data sources, users and alert configuration, and record the result.

Does Grafana Cloud remove the need for backups?

Not entirely. Grafana Cloud reduces the infrastructure you run, but your organization still needs to decide what its dashboards, alert rules and provisioning files are worth, where they are recorded, and how they can be rebuilt if the service or an account is lost. Teams that keep dashboards as code in Git can rebuild in another environment, whereas teams that rely only on the UI carry more risk. The Grafana pricing page lists tiers with different platform fees and usage charges, so a cloud decision should be made with the total cost and the exit path in view. Confirm what export and recovery options your chosen tier supports.

What breaks most often when a Grafana restore is attempted?

The most common failures come from missing pieces rather than corrupted data. Typical problems include a database dump restored into the wrong engine version, a grafana.ini that points at a different database host or a missing encryption secret, plugins that are absent or at a different version, and provisioning files that no longer match the restored database. Restore order also matters: the database and configuration should exist before Grafana starts, and provisioned resources should load in a predictable sequence. Keep a checklist for each item and confirm it during every restore test.

How DeployOpen scopes and tests Grafana backups

DeployOpen plans, implements, backs up, documents and supports self-hosted open-source platforms inside your own infrastructure, including Grafana. For backup and restore, we start from the restore goal, build the backup and restore runbooks around it, and prove them with a restore test in an environment you control.

How we scope

  • Inventory every Grafana state store: the metadata database, configuration, plugin folders, provisioning files and any local storage.
  • Agree the backup frequency, retention period and recovery priority with your data owners in the written scope.
  • Confirm which secrets, encryption keys and certificates the restore depends on, and where they are held.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.

How we build

  • Configure scheduled database dumps or snapshots for your chosen MySQL or PostgreSQL database and store them off the Grafana host.
  • Back up configuration and plugin folders, and keep dashboards, data sources and alert resources in version-controlled provisioning files.
  • Protect backup copies with encryption and separate storage so that recovery data is not stored alongside the original.
  • Write the restore order, from database and secrets to Grafana binaries, provisioning and plugin reinstallation, as a step-by-step runbook.

How we hand over

  • Deliver the written backup policy, restore runbook and a list of owners for each backup source and restore step.
  • Run a restore test into a separate environment and record what was restored, what was checked and what needed manual work.
  • Document the test results, open items and the schedule for repeating the restore test after substantive changes.
  • Train your operators on the runbook so that the restore does not depend on one person's knowledge.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, including repeat restore tests on a set schedule.
  • Review backups after each Grafana upgrade, plugin change or database migration, since these can change what must be restored.
  • Keep the runbook current with your environment, access model and provisioning layout as they change over time.
  • Quotes follow from the written scope, so ask for the restore test and review cadence to be itemized.

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.