MySQL Forums
Forum List  »  Newbie

Re: merge ibdata1 data
Posted by: Peter Brawley
Date: November 29, 2017 05:12PM

You have a new mysql installation with new data, you have ibdata files from a previous mysql installation, and you now wish to merge the two sets of databases?

Taking first the tables whose structures are the same across the two installations, you still can't just append one to the other without paying attention to primary keys. Where auto_increment is used, there will be duplicates; where not, you still need a policy for how to handle PK dupes.

For tables whose structures have changed, you have the above issues plus handling values for columns missing from one dataset.

So you'll need to do it manually, table by table.

So I'd install on another machine an instance of the previous mySQL version, then bring it down, kill the log files, copy in the old ibdata file, files bring up the server, check that all the data is recognised correctly, then generate a full mysqldump of all tables, data, events and stored routines, suck up that dump file into differently named databases in the new installation.

At that point you can merge table by table from old db(s) to new, applying whatever rules and PK adjustments are necessary.

Options: ReplyQuote


Subject
Written By
Posted
November 29, 2017 04:25PM
Re: merge ibdata1 data
November 29, 2017 05:12PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.