V
V
Vlad9112011-09-11 22:00:32
MySQL
Vlad911, 2011-09-11 22:00:32

Merge two databases?

Hello Great Habr!
Can you please tell me how to solve this problem?
There is one database in which there is a lot of data - millions of records.
There is a second database, which was obtained from the first one a long time ago by adding some fields to some tables.
You need some tool that would allow you to quickly upload data from the first database to the second database, taking into account the fact that it is unknown and don’t really want to know which new fields and which tables were added.
Those. need exactly tul.
DBMS MySQL.
Thank you!

Answer the question

In order to leave comments, you need to log in

4 answer(s)
K
Konstantin, 2011-09-12
@Norraxx

Do you need a tool? Please: SQL + mysql.exe or anything from the list + MySQL driver: C, C++, C#, Java, Go, D, Lisp, Scheme, Pascal, Visual Basic, Python, Fortran, PHP, Perl, Ruby, F# + I can continue to pervert with other languages.
And so I don’t want to think about your problem and I don’t really want to find out.
And finally, judging by your question, you don’t really want to decide something there, otherwise you yourself would sit and ask around in Google ...

K
korvindest, 2011-09-12
@korvindest

With all due respect to you, I want to note that the task of merging, even just text files, is far from always possible in automatic mode. What you want to do automatically is an order of magnitude more difficult, so whether you like it or not, you will most likely have to work hard with your head and hands.
I can only suggest ways to solve this problem.
1. Since the base is so large, there must be a schema for it. By comparing the differences between the two schemas, you can write SQL scripts that smerdat the data. If the database schema did not exist, then I highly recommend doing it.
2. You can try a slightly more perverted version, the performance of which I do not guarantee. With the help of a database manager (any, even phpMyAdmin), pour the structure and data into files. And merge as normal text files. But frankly, with large volumes, I would go crazy from this task.
Good luck!

V
Vlad911, 2011-09-12
@Vlad911

I understand, thanks. I found the solution to this particular problem in the form:
unload dumps, compare CREATE TABLE queries, write ALTER TABLE based on their differences.
Rewrite INSERT queries as INSERT INTO… SET.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question