mirror of
https://github.com/inventree/inventree-docs.git
synced 2025-04-27 21:26:43 +00:00
Backup docs (#421)
* Add new page for documenting backup procedure * Add info on backup procedure * Add info on auto-backup setting * Tweaks * Add admonition * Update docs for backup-during-update
This commit is contained in:
parent
67b97f1e4d
commit
6958e56daa
BIN
docs/assets/images/start/auto-backup.png
Normal file
BIN
docs/assets/images/start/auto-backup.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 203 KiB |
58
docs/start/backup.md
Normal file
58
docs/start/backup.md
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
---
|
||||||
|
title: Data Backup
|
||||||
|
---
|
||||||
|
|
||||||
|
## Data Backup
|
||||||
|
|
||||||
|
Backup functionality is provided natively using the [django-dbbackup library](https://django-dbbackup.readthedocs.io/en/master/). This library provides multiple options for creating backups of your InvenTree database and media files. In addition to local storage backup, multiple external storage solutions are supported (such as Amazon S3 or Dropbox).
|
||||||
|
|
||||||
|
Note that a *backup* operation is not the same as [migrating data](./migrate.md). While data *migration* exports data into a database-agnostic JSON file, *backup* exports a native database file and media file archive.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
The following configuration options are available for backup:
|
||||||
|
|
||||||
|
| Environment Variable | Configuration File | Description | Default |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| INVENTREE_BACKUP_STORAGE | backup_storage | Backup storage backend | django.core.files.storage.FileSystemStorage |
|
||||||
|
| INVENTREE_BACKUP_DIR | backup_dir | Backup storage directory | *No default* |
|
||||||
|
| INVENTREE_BACKUP_OPTIONS | backup_options | Specific backup options (dict) | *No default* |
|
||||||
|
|
||||||
|
### Storage Providers
|
||||||
|
|
||||||
|
If you want to use an external storage provider, extra configuration is required. As a starting point, refer to the [django-dbbackup documentation](https://django-dbbackup.readthedocs.io/en/master/storage.html).
|
||||||
|
|
||||||
|
Specific storage configuration options are specified using the `backup_options` dict (in the [configuration file](./config.md)).
|
||||||
|
|
||||||
|
## Perform Backup
|
||||||
|
|
||||||
|
#### Manual Backup
|
||||||
|
|
||||||
|
To perform a manual backup operation, run the following command from the shell:
|
||||||
|
|
||||||
|
```
|
||||||
|
invoke backup
|
||||||
|
```
|
||||||
|
|
||||||
|
### Backup During Update
|
||||||
|
|
||||||
|
When performing an update of your InvenTree installation - via either [docker](./docker.md) or [bare metal](./install.md) - a backup operation is automatically performed.
|
||||||
|
|
||||||
|
### Daily Backup
|
||||||
|
|
||||||
|
If desired, InvenTree can be configured to perform automated daily backups. The run-time setting to control this is found in the *Server Configuration* tab.
|
||||||
|
|
||||||
|
{% with id="auto-backup", url="start/auto-backup.png", description="Automatic daily backup" %}
|
||||||
|
{% include 'img.html' %}
|
||||||
|
{% endwith %}
|
||||||
|
|
||||||
|
!!! tip "Optional Feature"
|
||||||
|
Automated backup is disabled by default, and must be enabled by an admin user
|
||||||
|
|
||||||
|
## Restore from Backup
|
||||||
|
|
||||||
|
To restore from a previous backup, run the following command from the shell (within virtual environment if configured):
|
||||||
|
|
||||||
|
```
|
||||||
|
invoke restore
|
||||||
|
```
|
@ -225,6 +225,8 @@ docker-compose up -d
|
|||||||
|
|
||||||
Database and media files are stored external to the container, in the volume location specified in the `docker-compose.yml` file. It is strongly recommended that a backup of the files in this volume is performed on a regular basis.
|
Database and media files are stored external to the container, in the volume location specified in the `docker-compose.yml` file. It is strongly recommended that a backup of the files in this volume is performed on a regular basis.
|
||||||
|
|
||||||
|
Read more about [data backup](./backup.md).
|
||||||
|
|
||||||
### Exporting Database as JSON
|
### Exporting Database as JSON
|
||||||
|
|
||||||
To export the database to an agnostic JSON file, perform the following command:
|
To export the database to an agnostic JSON file, perform the following command:
|
||||||
|
@ -261,7 +261,7 @@ Refer to the [production server instructions](./production.md) for further infor
|
|||||||
Administrators wishing to update InvenTree to the latest version should follow the instructions below. The commands listed below should be run from the InvenTree root directory.
|
Administrators wishing to update InvenTree to the latest version should follow the instructions below. The commands listed below should be run from the InvenTree root directory.
|
||||||
|
|
||||||
!!! info "Update Database"
|
!!! info "Update Database"
|
||||||
It is advisable to backup the InvenTree database before performing these steps. The particular backup procedure may depend on your installation details.
|
It is advisable to [backup the InvenTree database](./backup.md) before performing these steps. The particular backup procedure may depend on your installation details.
|
||||||
|
|
||||||
### Stop InvenTree Server
|
### Stop InvenTree Server
|
||||||
|
|
||||||
|
@ -72,6 +72,7 @@ nav:
|
|||||||
- Installer: start/installer.md
|
- Installer: start/installer.md
|
||||||
- Development: start/development.md
|
- Development: start/development.md
|
||||||
- Production: start/production.md
|
- Production: start/production.md
|
||||||
|
- Data Backup: start/backup.md
|
||||||
- Migrating Data: start/migrate.md
|
- Migrating Data: start/migrate.md
|
||||||
- Parts:
|
- Parts:
|
||||||
- Parts: part/part.md
|
- Parts: part/part.md
|
||||||
|
Loading…
x
Reference in New Issue
Block a user