burke-software/django-sis — pull request #205 by saulshanabrook (2014-12-07 00:37:25+00:00)
Title: add scripts for adding in old data

**not ready for merge**

To merge in the old AWS data into the new multitenant setup, first get your machine setup for multitenant.

Then use `general scripts/import.sh` to download and import the old `atlanta` DB.

Current importing traceback:

```
Traceback (most recent call last):
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/tenant_schemas/management/commands/__init__.py", line 71, in handle
*args, **options)
File "/usr/local/lib/python2.7/dist-packages/tenant_schemas/management/commands/__init__.py", line 61, in execute_command
call_command(command_name, *args, **options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 159, in call_command
return klass.execute(*args, **defaults)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/loaddata.py", line 55, in handle
self.loaddata(fixture_labels)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/loaddata.py", line 84, in loaddata
self.load_label(fixture_label)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/loaddata.py", line 140, in load_label
obj.save(using=self.using)
File "/usr/local/lib/python2.7/dist-packages/django/core/serializers/base.py", line 164, in save
models.Model.save_base(self.object, using=using, raw=True)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 573, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 635, in _save_table
forced_update)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 679, in _do_update
return filtered._update(values) > 0
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 510, in _update
return query.get_compiler(self.db).execute_sql(None)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 980, in execute_sql
cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py", line 69, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 99, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
django.db.utils.IntegrityError: Problem installing fixture '/code/tmp/dump.json': Could not load contenttypes.ContentType(pk=2): duplicate key value violates unique constraint "django_content_type_app_label_model_key"
DETAIL: Key (app_label, model)=(south, migrationhistory) already exists.
```