2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 11:36:44 +00:00

Add documentation on transferring media files (#8803)

This commit is contained in:
Oliver 2024-12-31 14:01:18 +11:00 committed by GitHub
parent 5692f56630
commit c917c64aa1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -46,7 +46,6 @@ invoke update
This step ensures that the required database tables exist, and are at the correct schema version, which must be the case before data can be imported. This step ensures that the required database tables exist, and are at the correct schema version, which must be the case before data can be imported.
### Import Data ### Import Data
The new database should now be correctly initialized with the correct table structures required to import the data. Run the following command to load the databased dump file into the new database. The new database should now be correctly initialized with the correct table structures required to import the data. Run the following command to load the databased dump file into the new database.
@ -64,6 +63,18 @@ invoke import-records -c -f data.json
!!! warning "Character Encoding" !!! 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. 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.
### Copy Media Files
Any media files (images, documents, etc) that were stored in the original database must be copied to the new database. In a typical InvenTree installation, these files are stored in the `media` subdirectory of the InvenTree data location.
Copy the entire directory tree from the original InvenTree installation to the new InvenTree installation.
!!! warning "File Ownership"
Ensure that the file ownership and permissions are correctly set on the copied files. The InvenTree server process **must** have read / write access to these files. If not, the server will not be able to serve the media files correctly, and the user interface may not function as expected.
!!! warning "Directory Structure"
The expected locations of each file is stored in the database, and if the file paths are not correct, the media files will not be displayed correctly in the user interface. Thus, it is important that the files are transferred across to the new installation in the same directory structure.
## Migrating Data to Newer Version ## Migrating Data to Newer Version
If you are updating from an older version of InvenTree to a newer version, the migration steps outlined above *do not apply*. If you are updating from an older version of InvenTree to a newer version, the migration steps outlined above *do not apply*.