Reputation: 81
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 ?
Upvotes: 6
Views: 5381
Reputation: 2535
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
Upvotes: 12