mirror of
https://github.com/inventree/inventree-docs.git
synced 2025-04-28 13:46:54 +00:00
Merge pull request #106 from inventree/backup
Update documentation for dbbackup
This commit is contained in:
commit
72af69e32b
@ -85,6 +85,7 @@ email:
|
||||
port: 25
|
||||
username: ''
|
||||
password: ''
|
||||
sender: ''
|
||||
tls: False
|
||||
ssl: False
|
||||
|
||||
@ -137,12 +138,6 @@ static_root: '/home/inventree/static'
|
||||
# - git
|
||||
# - ssh
|
||||
|
||||
# Backup options
|
||||
# Set the backup_dir parameter to store backup files in a specific location
|
||||
# If unspecified, the local user's temp directory will be used
|
||||
# Use environment variable INVENTREE_BACKUP_DIR
|
||||
backup_dir: '/home/inventree/data/backup/'
|
||||
|
||||
# Permit custom authentication backends
|
||||
#authentication_backends:
|
||||
# - 'django.contrib.auth.backends.ModelBackend'
|
||||
|
@ -121,12 +121,6 @@ By default, uploaded media files are stored in the local directory `/home/invent
|
||||
|
||||
Alternatively this location can be specified with the `INVENTREE_MEDIA_ROOT` environment variable.
|
||||
|
||||
### Backup Location
|
||||
|
||||
The default behaviour of the database backup is to generate backup files for database tables and media files to `/home/inventree/backup`. The target directory can be overridden by setting the `backup_dir` parameter in the config file.
|
||||
|
||||
Alternatively this location can be specified with the `INVENTREE_BACKUP_DIR` environment variable.
|
||||
|
||||
## Other Options
|
||||
|
||||
### Authentication Backends
|
||||
|
@ -273,3 +273,17 @@ As part of the server initialization process, data migrations and static file up
|
||||
```
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
## Data Backup
|
||||
|
||||
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.
|
||||
|
||||
### Exporting Database as JSON
|
||||
|
||||
To export the database to an agnostic JSON file, perform the following command:
|
||||
|
||||
```
|
||||
docker-compose run inventree-server invoke export-records /home/inventree/data/data.json
|
||||
```
|
||||
|
||||
This will export database records to the file `data.json` in your mounted volume directory.
|
||||
|
@ -53,7 +53,7 @@ This step creates directories required by InvenTree:
|
||||
|
||||
* `/home/inventree/log` - Store InvenTree log files
|
||||
* `/home/inventree/static` - Location of static files for the web server
|
||||
* `/home/inventre/data` - Location of stored media and backup files
|
||||
* `/home/inventre/data` - Location of uploaded media files
|
||||
|
||||
### Download Source Code
|
||||
|
||||
|
@ -52,19 +52,3 @@ inv import-records -f data.json
|
||||
|
||||
!!! warning "Character Encoding"
|
||||
If the character encoding of the data file does not exactly match the target database, the import operation may not succeed. In this case, some manual editing of the database JSON file may be required.
|
||||
|
||||
### Backup and Restore
|
||||
|
||||
To backup your database data and media files, first define a [Backup Location](../config/#backup-location) in your configuration file.
|
||||
|
||||
Then run the following command to backup the data:
|
||||
```
|
||||
inv backup
|
||||
```
|
||||
|
||||
It should create two separate backup files in the [Backup Location](../config/#backup-location) folder: one for the database data and one for the media files (part pictures, etc.)
|
||||
|
||||
To restore your data from a backup, use the following command:
|
||||
```
|
||||
inv restore
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user