mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-14 19:15:41 +00:00
* Add builtin plugin for auto-issuing orders * Add plugin to auto-issue orders * Add placeholder documentation * Fix typo * Adds image macro - To replace img.html - includes checking if file exists * Fix tooltips * More docs * Adjust plugin settings filters * docs * More docs * More docs * Updates * Less restrictive URL checking * Refactor build order page * Fix typo * Allow 429 * Debug output * More debug * Construct assets dir * Cleanup * Update docs README * Refactoring more pages * Fix image link * Fix SSO settings * Add hook to check for missing settings - Ensure that all settings are documented! * Add missing user settings * Update docstring * Tweak SSO.md * Image updates * More updates * Tweaks * Exclude orders without a target_date * Fix for issuing build orders * Further refactoring * Fixes * Image refactoring * More refactoring * More refactoring * Refactor app images * Fix pathing issues * Suppress some openapidocs warnings in logs (much easier to debug docs build issues) * Fix image reference * Reduce error messages * Fix image links * Fix image links * Reduce docs log output * Ensure settings are loaded before displaying them * Fix for UI test * Fix unit test * Test tweaks
80 lines
3.2 KiB
Markdown
80 lines
3.2 KiB
Markdown
---
|
|
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.
|
|
|
|
!!! warning "Database Version"
|
|
When performing backup and restore operations, it is *imperative* that you are running from the same installed version of InvenTree. Different InvenTree versions may have different database schemas, which render backup / restore operations incompatible.
|
|
|
|
## 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#backup-file-storage)).
|
|
|
|
## Perform Backup
|
|
|
|
#### Manual Backup
|
|
|
|
To perform a basic manual backup operation, run the following command from the shell:
|
|
|
|
```
|
|
invoke backup
|
|
```
|
|
|
|
This will perform backup operation with the default parameters. To see all available backup options, run:
|
|
|
|
```
|
|
invoke backup --help
|
|
```
|
|
|
|
### 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.
|
|
|
|
!!! info "Skip Backup Step"
|
|
You can opt to skip the backup step during the update process by adding the `--skip-backup` option.
|
|
|
|
### 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.
|
|
|
|
!!! 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
|
|
```
|
|
|
|
To see all available options for restore, run:
|
|
|
|
```
|
|
invoke restore --help
|
|
```
|
|
|
|
## Advanced Usage
|
|
|
|
Not all functionality of the db-backup library is exposed by default. For advanced usage (not covered by the documentation above), refer to the [django-dbbackup commands documentation](https://django-dbbackup.readthedocs.io/en/master/commands.html).
|
|
|
|
!!! warning "Advanced Users Only"
|
|
Any advanced usage assumes some underlying knowledge of django, and is not documented here.
|