MySQL Forums
Forum List  »  Newbie

MySQL: Merge Databases
Posted by: Jens Peterson
Date: May 07, 2018 02:39PM


I have an almost regular WordPress setup including a mySQL database (Server A). On March 1st 2018 this installation and mySQL database was copied to a new server (Server B). On the new server (B) a lot of things got improved and a new domain name was assigned. Also the prefix of the database has changed.

Between March 1st and now this database (B) did not get any user registrations, however as said above it did get several updates and improvements for pages and general behaviour.

I have successfully used phpmyadmin to export the database from the current installation (A) again (on May 5th) and import it into the new server (B) as a second database.

What should happen now, is that the latest changes of (B) [March 1st + improvements etc.] should be merged together with the latest changes of (A) [March 1st + user registrations and user activities that happend on the current page between March 1st and May 5th].

1. Can I merge the two databases as a whole (with one command), if the tables are the same (I have not really compared each of the tables and it's columns, but as I have not changed any plugins and all the table names are identical - no table has been added or deleted - I guess I can say the structure is identical?)?
2. Is there a way of using phpmyadmin to do that?
3. Should I be using "REPLACE" or "INSERT" or "INSERT ... ON DUPLICATE KEY UPDATE" or something completely different? I do not understand what would be correct here.
4. Once I have managed to mergen the data, what is a good way of updating all URL's to the new domain? In the new installation both databases (A) & (B) still have the wrong URL's.

Many thanks for your help.

Options: ReplyQuote

Written By
MySQL: Merge Databases
May 07, 2018 02:39PM

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.