Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6925553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:48:15+00:00 2026-05-27T10:48:15+00:00

I have a production server running, and a local development one (this one uses

  • 0

I have a production server running, and a local development one (this one uses the simple runserver, etc.).

I was planning on using Django’s built in “dumpdata” command in order to create backups of the database every so often. Sadly, I can’t seem to get “loaddata” to take in what “dumpdata” provides it.

On the production server:

python manage.py dumpdata > db_backup.json

This gives me a ~6MB file, which I then transfer over to my local machine. On my local machine:

bash-3.2$ python manage.py flush --settings=config.settings_dev
/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/db/models/fields/subclassing.py:80: DeprecationWarning: A Field class whose get_db_prep_save method hasn't been updated to take a `connection` argument.
  new_class = super(SubfieldBase, cls).__new__(cls, name, bases, attrs)
You have requested a flush of the database.
This will IRREVERSIBLY DESTROY all data currently in the 'dcif_db' database,
and return each table to the state it was in after syncdb.
Are you sure you want to do this?

    Type 'yes' to continue, or 'no' to cancel: yes

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): no
Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_manager(settings)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/core/management/commands/flush.py", line 74, in handle_noargs
    emit_post_sync_signal(set(all_models), verbosity, interactive, db)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/core/management/sql.py", line 190, in emit_post_sync_signal
    interactive=interactive, db=db)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/contrib/auth/management/__init__.py", line 51, in create_permissions
    content_type=ctype
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/db/models/manager.py", line 138, in create
    return self.get_query_set().create(**kwargs)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/db/models/query.py", line 360, in create
    obj.save(force_insert=True, using=self.db)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/db/models/base.py", line 460, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/db/models/base.py", line 553, in save_base
    result = manager._insert(values, return_id=update_pk, using=using)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/db/models/manager.py", line 195, in _insert
    return insert_query(self.model, values, **kwargs)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/db/models/query.py", line 1436, in insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 791, in execute_sql
    cursor = super(SQLInsertCompiler, self).execute_sql(None)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 735, in execute_sql
    cursor.execute(sql, params)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/db/backends/util.py", line 34, in execute
    return self.cursor.execute(sql, params)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
    return self.cursor.execute(query, args)
django.db.utils.DatabaseError: can't adapt type '__proxy__'

I’ve had this problem a few weeks ago, and just running whatever command generated the error a second time made the error go away. Not the ideal solution, but I’m not sure how else to fix it.

Then:

bash-3.2$ python manage.py loaddata etc/db_backups/12_9_11.json --settings=config.settings_dev
/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/db/models/fields/subclassing.py:80: DeprecationWarning: A Field class whose get_db_prep_save method hasn't been updated to take a `connection` argument.
  new_class = super(SubfieldBase, cls).__new__(cls, name, bases, attrs)
Problem installing fixture 'etc/db_backups/12_9_11.json': Traceback (most recent call last):
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/core/management/commands/loaddata.py", line 174, in handle
    obj.save(using=using)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/core/serializers/base.py", line 165, in save
    models.Model.save_base(self.object, using=using, raw=True)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/db/models/base.py", line 570, in save_base
    created=(not record_exists), raw=raw, using=using)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/Applications/djangostack-1.3-0/python/lib/python2.6/site-packages/djangobb_for_dcif/signals.py", line 18, in post_saved
    profile = post.user.forum_profile
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/db/models/fields/related.py", line 315, in __get__
    rel_obj = QuerySet(self.field.rel.to).using(db).get(**params)
  File "/Applications/djangostack-1.3-0/apps/django/lib/python2.6/site-packages/django/db/models/query.py", line 349, in get
    % self.model._meta.object_name)
DoesNotExist: User matching query does not exist.

Shouldn’t the .json file provided by dumpdata be consistent, and not have missing objects as this error seems to claim?

On the production server, I’m using MySQL, and I’m using PostgreSQL locally, so I’m not sure if that’s the cause of the problem.

Is there an easier way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:48:15+00:00Added an answer on May 27, 2026 at 10:48 am

    I think best way to do this export tables as simple sql inserts statements
    then you can re rerun insert sql scripts in target db

    I’am using this method. I also tried dumpdata etc but insert statement way is easy and not complex.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this ASP.NET/SQLServer2005 website running on a production server (Win2003, QuadCore, 4GB). The
I have a production server running with the following flag: - XX:+HeapDumpOnOutOfMemoryError Last night
So the scenario is this: I have a mySQL database on a local server
On my development system I have a Solr server running that is queried by
We have a production SQL Server 2005 database server with the production version of
We currently have in production SQL Server 2005 and we use it's full text
I have deployed a new build on Production server, but I dont see the
I have 2 test and 1 production server. In my global.asax file - I
I have ELMAH setup on my production server and it has done a fantastic
Let's say I have two database instances: InstanceA - Production server InstanceB - Test

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.