'export data from Django database

how to copy records from one database to another django ?

I tried for the first database

python manage.py dumpdata material - indent = 1

material is the directory database after ?

material.json ?

do I copy this file somewhere? in the second database ?



Solution 1:[1]

You can use this command to dump the data to a json file:

python manage.py dumpdata material --indent=1 > my_dir/material.json

And then this command to load it into the database:

python manage.py loaddata my_dir/material.json

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 CJ4