mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-02 05:26:45 +00:00
Add documentation for data migration
This commit is contained in:
parent
0480925186
commit
e32048d3c6
@ -14,6 +14,7 @@ InvenTree Source Documentation
|
|||||||
Tables<tables>
|
Tables<tables>
|
||||||
REST API<rest>
|
REST API<rest>
|
||||||
Backup and Restore<backup>
|
Backup and Restore<backup>
|
||||||
|
Migrate Data<migrate>
|
||||||
InvenTree Modules <modules>
|
InvenTree Modules <modules>
|
||||||
Module Reference<reference>
|
Module Reference<reference>
|
||||||
|
|
||||||
|
33
docs/migrate.rst
Normal file
33
docs/migrate.rst
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
Migrating Data
|
||||||
|
==============
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:titlesonly:
|
||||||
|
:maxdepth: 2
|
||||||
|
:caption: Migrating Data
|
||||||
|
:hidden:
|
||||||
|
|
||||||
|
In the case that data needs to be migrated from one database installation to another, the following procedure can be used to export data, initialize the new database, and re-import the data.
|
||||||
|
|
||||||
|
Export Data
|
||||||
|
-----------
|
||||||
|
|
||||||
|
``python3 manage.py dumpdata --exclude contenttypes --exclude auth.permission --indent 2 > data.json``
|
||||||
|
|
||||||
|
This will export all data (including user information) to a json data file.
|
||||||
|
|
||||||
|
Initialize Database
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Configure the new database using the normal processes (see `Getting Started <start.html>`_):
|
||||||
|
|
||||||
|
``python3 manage.py makemigrations``
|
||||||
|
|
||||||
|
``python3 manage.py migrate --run-syncdb``
|
||||||
|
|
||||||
|
Import Data
|
||||||
|
-----------
|
||||||
|
|
||||||
|
The new database should now be correctly initialized with the correct table structures requried to import the data.
|
||||||
|
|
||||||
|
``python3 manage.py loaddata data.json``
|
Loading…
x
Reference in New Issue
Block a user