On Tue, Jan 22, 2013 at 11:54 AM, Sandeep kaur <mkaurkha...@gmail.com> wrote:
> Yes, I also thought south will be helpful but when we need to do
> complete migration like old table is without foreign keys but new
> table has foreign keys etc. then I could not understand how to use
> south. Can you provide me some tutorial for the same.


I haven't used South for complex data migrations, but I think it's
most useful just after (or simultaneously to) doing the schema
migration with South.  In your case, you sound like you haven't done
any real schema migration, more like a reimplementation.

(( unless it is just a change to the application and your talk about
"new application" and "old application" means just that you're not
using any version control system.  in that case, no matter what i
advice here, you're already in deep trouble ))

if you've done a real reimplementation, then I don't think there's any
tool to do much help.  you have to write a third application that
reads data in the old representation and writes in the new one.  and
run that app once.

of course, if both old and new applications are written with Django
and handle data via the Django ORM, then you can do things like:


import oldapp.models
import newapp.models

for oldrec in oldapp.models.MyModel.objects.all():
    newapp.models.MyNewModel.create (newfield=oldrec.oldfield,......)


and so on.

--
Javier

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to