Skip to content
John Heasly edited this page Nov 19, 2017 · 13 revisions

How to update civic_calendar2 with civic_calendar data

loaddata auth.user.json loaddata entity.json (requires search & replace) loaddata location.json (requires search & replace) loaddata munged_schedule_event.json (output of json_transformer.py)

  1. Get your Schedule.Event/Civic_calendar.Meeting house in order by first doing the scripts/json_transformer.py munge dance, as you may have Entity and/or Location data that references uncreated/non-existent Schedule.Event and/or User.
  2. Log in to civic_calendar on live django110 server, use Django utility dumpdata to export full civic_calendar and schedule apps.
$ python manage.py dumpdata schedule --format=json --indent=2 --settings=django_root.settings.production > schedule.json
$ python manage.py dumpdata civic_calendar --format=json --indent=2 --settings=django_root.settings.production > civic_calendar.json
  1. Copy schedule.json and civic_calendar.json to civic_calendar2/scripts directory, cd down to civic_calendar2/scripts and run json_transformer.py
  2. cd up to django_root and use loaddata to import the resulting munged_schedule_event.json file.
  3. Still using civic_calendar on live django110 server, use Django utility dumpdata to export Entity, Location model data. Probably won't need to export Jursidiction (unless there's been a new city/town added).
$ python manage.py dumpdata civic_calendar.entity --format=json --indent=2 --settings=django_root.settings.production > civic_calendar.entity.json
$ python manage.py dumpdata civic_calendar.location --format=json --indent=2 --settings=django_root.settings.production > civic_calendar.location.json
  1. Search and replace civic_calendar.entity with civic_calendar2.entity.
  2. Search and replace civic_calendar.location with civic_calendar2.location.
  3. loaddata into your django111 civic_calendar2 app.
Clone this wiki locally