Created
November 5, 2020 14:46
-
-
Save MarlonJD/baf472f13686087f99911b5595a77c26 to your computer and use it in GitHub Desktop.
Backup All Django project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Restore fresh database | |
When you backup whole database by using dumpdata command, it will backup all the database tables | |
If you use this database dump to load the fresh database(in another django project), it can be causes IntegrityError (If you loaddata in same database it works fine) | |
To fix this problem, make sure to backup the database by excluding contenttypes and auth.permissions tables | |
python manage.py dumpdata --exclude auth.permission --exclude contenttypes > db.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment