-
dump the current db of django project settings
python manage.py dumpdata > dbdump.json
-
Change the database settings to new database
-
run
migrate
command to set up the new database *if the new database does not have same model (tables), as when creating new databasepython manage.py migrate
-
open django shell
python manage.py shell
Enter the following in the shell
from django.contrib.contenttypes.models import ContentType ContentType.objects.all().delete()
-
then, load the data from
dbdump.json
python manage.py loaddata dbdump.json
Created
December 4, 2022 01:44
-
-
Save sakku116/d74d83b76de32ce8f228d847899be552 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment