Kenny Shen
Kenny Shen

Reputation: 4883

Migrating data from one Django project to another

So I have a client who cloned an old project in Django to start working on a brand new theme and features. Now they're needing to move the data from the old project to the new one (User and other similar tables). Some of the main models on the old project have significant changes on the newer version. I want to ask if there's any good route of doing this kind of migration?

Upvotes: 0

Views: 958

Answers (1)

Issac Kelly
Issac Kelly

Reputation: 6359

Sure, here it is in several easy steps using south.

  1. Clone the old project and database (or at least, make a backup)
  2. Put the old models into south.
  3. Create migrations, step by step for your changes with South, until your models match the new models.
  4. (on old/converted project) python manage.py dumpdata myapp > myapp.json
  5. Move the json fixture to the new project.
  6. (on new project) python manage.py loaddata myapp.json

Upvotes: 2

Related Questions