Docs/creates backup grafana topic (#74754)

* starts to step out the backup content

* adds shared shortcode

* shares intro content

* Update docs/sources/administration/back-up-grafana/index.md

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

* updates 10 and 9.5 upgrade guides with shared content

* makes prettier

* incorporates feedback

---------

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
This commit is contained in:
Christopher Moyer 2023-09-13 04:35:04 -05:00 committed by GitHub
parent de9b658b7f
commit a7bf303832
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 129 additions and 56 deletions

View File

@ -0,0 +1,15 @@
---
description: Describes how to back up a locally provisioned Grafana instance.
keywords:
- grafana
- backup
labels:
products:
- enterprise
- oss
title: Back up Grafana
weight: 80
menuTitle: Back up Grafana
---
{{< docs/shared lookup="back-up/back-up-grafana.md" source="grafana" version="<GRAFANA VERSION>" >}}

View File

@ -0,0 +1,77 @@
---
headless: true
labels:
products:
- enterprise
- oss
title: Back up Grafana
---
# Back up Grafana
This topic explains how to back up a local Grafana deployment, including configuration, plugin data, and the Grafana database.
## Back up the Grafana configuration file
Copy Grafana configuration files that you might have modified in your Grafana deployment to a backup directory.
The Grafana configuration files are located in the following directories:
- Default configuration: `$WORKING_DIR/conf/defaults.ini`
- Custom configuration: `$WORKING_DIR/conf/custom.ini`
{{% admonition type="note" %}}
If you installed Grafana using the `deb` or `rpm` packages, then your configuration file is located at
`/etc/grafana/grafana.ini`. This path is specified in the Grafana `init.d` script using `--config` file parameter.
{{% /admonition %}}
## Back up plugin data
Installing plugins in Grafana creates a folder for each plugin with its associated files and data. Copy all files and folders recursively from this location to your backup repository.
The Grafana plugin files are located in the following directories:
- Default location for plugins in a binary or source installation: `$WORKING_DIR/data/plugins`
- Default location for plugins in a `deb` or `rpm` package: `/var/lib/grafana/plugins`. This path is specified in the Grafana init.d script using `--config` file parameter.
## Back up the Grafana database
We recommend that you back up your Grafana database so that you can roll back to a previous version, if required.
### SQLite
The default Grafana database is SQLite, which stores its data in a single file on disk. To back up this file, copy it to your backup repository.
{{% admonition type="note" %}}
To ensure data integrity, shut down your Grafana service before backing up the SQLite database.
{{% /admonition %}}
The SQLite database file is located in one of the following directories:
- Default location for SQLite data in a binary or source installation: `$WORKING_DIR/data/grafana.db`
- Default location for SQLite data in a `deb` or `rpm` package: `/var/lib/grafana/grafana.db`. This path is specified in the Grafana
init.d script using `--config` file parameter.
### MySQL
To back up or restore a MySQL Grafana database, run the following commands:
```bash
backup:
> mysqldump -u root -p[root_password] [grafana] > grafana_backup.sql
restore:
> mysql -u root -p grafana < grafana_backup.sql
```
### Postgres
To back up or restore a Postgres Grafana database, run the following commands:
```bash
backup:
> pg_dump grafana > grafana_backup
restore:
> psql grafana < grafana_backup
```

View File

@ -0,0 +1,25 @@
---
headless: true
labels:
products:
- enterprise
- oss
title: Upgrade guide introduction
---
We recommend that you upgrade Grafana often to stay current with the latest fixes and enhancements.
Because Grafana upgrades are backward compatible, the upgrade process is straightforward, and dashboards and graphs will not change.
In addition to common tasks you should complete for all versions of Grafana, there might be additional upgrade tasks to complete for a version.
{{% admonition type="note" %}}
There might be breaking changes in some releases. We outline these changes in the [What's New ]({{< relref "../../whatsnew/" >}}) document for most releases or a separate [Breaking changes]({{< relref "../../breaking-changes/" >}}) document for releases with many breaking changes.
{{% /admonition %}}
For versions of Grafana prior to v9.2, we published additional information in the [Release Notes]({{< relref "../../release-notes/" >}}).
When available, we list all changes with links to pull requests or issues in the [Changelog](https://github.com/grafana/grafana/blob/main/CHANGELOG.md).
{{% admonition type="note" %}}
When possible, we recommend that you test the Grafana upgrade process in a test or development environment.
{{% /admonition %}}

View File

@ -6,62 +6,6 @@ labels:
title: Upgrade guide common tasks
---
We recommend that you upgrade Grafana often to stay current with the latest fixes and enhancements.
Because Grafana upgrades are backward compatible, the upgrade process is straightforward, and dashboards and graphs will not change.
In addition to common tasks you should complete for all versions of Grafana, there might be additional upgrade tasks to complete for a version.
{{% admonition type="note" %}}
There might be breaking changes in some releases. We outline these changes in the [What's New ]({{< relref "../../whatsnew/" >}}) document for most releases or a separate [Breaking changes]({{< relref "../../breaking-changes/" >}}) document for releases with many breaking changes.
{{% /admonition %}}
For versions of Grafana prior to v9.2, we published additional information in the [Release Notes]({{< relref "../../release-notes/" >}}).
When available, we list all changes with links to pull requests or issues in the [Changelog](https://github.com/grafana/grafana/blob/main/CHANGELOG.md).
{{% admonition type="note" %}}
When possible, we recommend that you test the Grafana upgrade process in a test or development environment.
{{% /admonition %}}
## Back up the Grafana database
Although Grafana automatically upgrades the database on startup, we recommend that you back up your Grafana database so that you can roll back to a previous version, if required.
### SQLite
If you use SQLite, you only need to back up the `grafana.db` file. On Unix systems, the database file is usually located in `/var/lib/grafana/`.
If you are unsure which database you use and where it is stored, check the Grafana configuration file. If you
installed Grafana to a custom location using a binary tar/zip, the database is usually located in `<grafana_install_dir>/data`.
### MySQL
To back up or restore a MySQL Grafana database, run the following commands:
```bash
backup:
> mysqldump -u root -p[root_password] [grafana] > grafana_backup.sql
restore:
> mysql -u root -p grafana < grafana_backup.sql
```
### Postgres
To back up or restore a Postgres Grafana database, run the following commands:
```bash
backup:
> pg_dump grafana > grafana_backup
restore:
> psql grafana < grafana_backup
```
## Backup plugins
We recommend that you back up installed plugins before you upgrade Grafana so that you can roll back to a previous version of Grafana, if necessary.
## Upgrade Grafana
The following sections provide instructions for how to upgrade Grafana based on your installation method.

View File

@ -16,6 +16,10 @@ weight: 1700
# Upgrade to Grafana v10.0
{{< docs/shared lookup="upgrade/intro.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< docs/shared lookup="back-up/back-up-grafana.md" source="grafana" version="<GRAFANA VERSION>" leveloffset="+1" >}}
{{< docs/shared lookup="upgrade/upgrade-common-tasks.md" source="grafana" version="<GRAFANA VERSION>" >}}
## Technical notes

View File

@ -12,6 +12,10 @@ weight: 1600
# Upgrade to Grafana v10.1
{{< docs/shared lookup="upgrade/intro.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< docs/shared lookup="back-up/back-up-grafana.md" source="grafana" version="<GRAFANA VERSION>" leveloffset="+1" >}}
{{< docs/shared lookup="upgrade/upgrade-common-tasks.md" source="grafana" version="<GRAFANA VERSION>" >}}
## Technical notes

View File

@ -16,6 +16,10 @@ weight: 1800
# Upgrade to Grafana v9.5
{{< docs/shared lookup="upgrade/intro.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< docs/shared lookup="back-up/back-up-grafana.md" source="grafana" version="<GRAFANA VERSION>" leveloffset="+1" >}}
{{< docs/shared lookup="upgrade/upgrade-common-tasks.md" source="grafana" version="<GRAFANA VERSION>" >}}
## Technical notes