2
0
mirror of https://github.com/inventree/inventree-docs.git synced 2025-04-28 05:36:46 +00:00

Updated instructions for migration of database content

This commit is contained in:
Oliver Walters 2020-11-12 12:40:38 +11:00
parent 842ee59105
commit baa77eaa27

View File

@ -11,8 +11,14 @@ In the case that data needs to be migrated from one database installation to ano
### Export Data ### Export Data
Export the database contents to a JSON file using the following command:
!!! info "Directory"
The following command must be performed from the directory which contains the manage.py file
``` ```
python3 InvenTree/manage.py dumpdata --exclude contenttypes --exclude auth.permission --indent 2 > data.json cd InvenTree
python3 manage.py dumpdata --exclude contenttypes --exclude auth.permission --indent 2 --output data.json
``` ```
This will export all data (including user information) to a json data file. This will export all data (including user information) to a json data file.
@ -32,7 +38,7 @@ invoke migrate
The new database should now be correctly initialized with the correct table structures requried 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 requried to import the data. Run the following command to load the databased dump file into the new database.
``` ```
python3 InvenTree/manage.py loaddata data.json python3 manage.py loaddata data.json
``` ```
!!! info "Character Encoding" !!! info "Character Encoding"