InvenTree/docs/migrate.rst
2019-09-02 17:04:44 +10:00

954 B

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> </head>

Migrating Data

System Message: ERROR/3 (<stdin>, line 4)

Unknown directive type "toctree".

.. 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 InvenTree/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):

python3 InvenTree/manage.py makemigrations

python3 InvenTree/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 InvenTree/manage.py loaddata data.json

</html>