Importing a data snapshot: Difference between revisions

Updated instructions for loading a snapshot
imported>Nshemonsky
imported>Blues chick
(Updated instructions for loading a snapshot)
Line 1:
{{Hacking OpenHatch}}
When you get your own instance of the OpenHatch code running, you'll discover you're missing the ''data'' that are on the main OpenHatch site. SoTo assist developers that are working on features that ''data'' would be helpful, we take periodic snapshots of the data on the main openhatch.org site.
 
== Where you can find the snapshots ==
 
You may download a snapshot of the OpenHatch data from:
* http://inside.openhatch.org/snapshots/
 
'''Note''': We go through some effort to remove private information before we publish user data in these snapshots. The code for that is [https://github.com/openhatch/oh-mainline/blob/master/mysite/customs/management/commands/snapshot_public_data.py here].
 
== Privacy implications ==
Line 12 ⟶ 15:
== How to use a snapshot ==
 
'''Note''': You must run
To load a snapshot into your database, you can run this command from your local install.
 
<tt>python manage.py syncdb --noinput</tt>
 
and
 
<tt>python manage.py migrate</tt>
 
'''Note''':before Youthe must run <tt>python manage.py syncdb --noinput</tt> and <tt>python manage.py migrate</tt> beforefollowing thissteps will work. Read <tt>README.mkd</tt> to learn more about those commands. It should take less than one minute.
 
 
1. Copy the downloaded snapshot file into the 'oh-mainline' directory. The snapshot file is named as ''date.json.gz'' where 'date' is in the form YYYY-MM-DD.
'''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.
 
Once2. To load the snapshot file has been retrieved oninto your computerdatabase, loadinput itthe following (no need to uncompress the snapshot file):
 
python manage.py loaddata ''2012-08-12.json.gz''
Line 24 ⟶ 36:
Installed 94858 object(s) from 1 fixture(s)
 
3. Then, run the following command to update the database file ''mysite.db'' with the new data snapshot:
 
python manage.py syncdb
Anonymous user