Export data from one Django to another
Sometimes I clone a repository with Django and make a setup of the environment on my own machine. Then I would usually like to have some testdata populated in my environment. So here’s how to copy the data from one Django installation (production) to my environment (test). 1. ssh to the remote server
ssh username@hostname
- Navigate to the folder
cd /path/to/remote/django
- Extract data to db.json
python manage.py dumpdata db.json
- Open a local terminal and copy down the file
scp username@hostname:/path/to/remote/django/db.json /path/to/local/django/db.json
- Navigate to the folder locally
cd /path/to/local/django/
- Import the data from the file
python manage.py loaddata db.json
Source: this guide
Previous postDo not design your own newsletter emails!
Next PostParallax: solve it with CSS