diff --git a/_includes/config.yaml b/_includes/config.yaml index e9f32f3..de09e37 100644 --- a/_includes/config.yaml +++ b/_includes/config.yaml @@ -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' @@ -158,4 +153,4 @@ backup_dir: '/home/inventree/data/backup/' # - 'django.contrib.auth.middleware.AuthenticationMiddleware' # - 'django.contrib.messages.middleware.MessageMiddleware' # - 'django.middleware.clickjacking.XFrameOptionsMiddleware' -# - 'InvenTree.middleware.AuthRequiredMiddleware' \ No newline at end of file +# - 'InvenTree.middleware.AuthRequiredMiddleware' diff --git a/docs/start/config.md b/docs/start/config.md index 891d364..2c4a68a 100644 --- a/docs/start/config.md +++ b/docs/start/config.md @@ -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 diff --git a/docs/start/docker.md b/docs/start/docker.md index 6d9c3e1..278f75c 100644 --- a/docs/start/docker.md +++ b/docs/start/docker.md @@ -272,4 +272,18 @@ As part of the server initialization process, data migrations and static file up ``` docker-compose up -d -``` \ No newline at end of file +``` + +## 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. diff --git a/docs/start/install.md b/docs/start/install.md index 03044ec..a93662e 100644 --- a/docs/start/install.md +++ b/docs/start/install.md @@ -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 diff --git a/docs/start/migrate.md b/docs/start/migrate.md index 4f6bfa2..72217eb 100644 --- a/docs/start/migrate.md +++ b/docs/start/migrate.md @@ -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 -``` diff --git a/docs/start/update.md b/docs/start/update.md index e0fe291..1b73a2e 100644 --- a/docs/start/update.md +++ b/docs/start/update.md @@ -43,4 +43,4 @@ This command performs the following steps: ### Restart Server -Ensure the InvenTree server is restarted. This will depend on the particulars of your database installation. \ No newline at end of file +Ensure the InvenTree server is restarted. This will depend on the particulars of your database installation.