Importing a data snapshot: Difference between revisions

→‎How to use a snapshot: The snapshot does not need to be ungzipped
imported>Paulproteus
No edit summary
imported>E2jk
(→‎How to use a snapshot: The snapshot does not need to be ungzipped)
Line 14:
To load a snapshot into your database, you can run this command from your local install.
 
'''Note''': You must run "<tt>python manage.py syncdb" --noinput</tt> and "<tt>python manage.py migrate"</tt> before this will work. Read <tt>README.mkd</tt> to learn more about those commands. It should take less than one minute.
 
Once the snapshot file has been retrieved on your computer, load it (no need to uncompress the file):
Uncompress it, and load it:
 
gunzippython snapshotmanage.py loaddata ''2012-08-12.json.gz''
python manage.py loaddata ''snapshot.json''
 
You'll see output that looks something like this:
 
Installed 2528894858 object(s) from 1 fixture(s)
Installing json fixture 'snapshot' from absolute path.
Installed 25288 object(s) from 1 fixture(s)
 
You can test that it worked by loading up your local people page and the live one. Do you have the about the same number of people? Click on these things:
* http://openhatch.org/people/
* http://127.0.0.1:8000/people/
Anonymous user