Saturday, October 25, 2014

Re: Merge two Databases into one

Larry's right, if it's a one time thing, use

mysqldump -u YOUR_DB_USER -p OLD_DB --no-create-info > SOME_FILE.sql

from the command line. Then, to import, use:
mysqlimport -u YOUR_DB_USER -p NEW_DB SOME_FILE.sql

To be sure you understand what's happening, check the docs first:

http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html
and
http://dev.mysql.com/doc/refman/5.0/en/mysqlimport.html

Also, don't forget to create a backup of your new_db (by using mysqldump as described above, just without the --no-create-info)


Unrelated to your question, but you might also want to consider to upgrade your Django installation to something newer than 1.3 ;)


On Friday, October 24, 2014 7:17:12 PM UTC+2, Ram Ganesh wrote:
Hi all,

I want to append my datas from old_db to new_db
they have exactly the same structure,

I'm trying to Write a Script using Django Manually selecting a database
  -Read data from old_db and Write it into new_db
  -But not sure its work fine with maintaining foreign key relationships.

what do you think would be the best solution for my problem?

using MySql,
Django 1.3

Thanks,
Ram Ganesh K

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6e90c27c-488f-4cbc-b350-9b93a21f936a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment