The problem if have is this.
We have taken over a website which has an active member community. We've been given the application and database dump and have the site running on a new server successfully and the DNS has been switched.
The problem is that the database has come out of sync in the time it took to get the files to us and the DNS switched over. Now that the DNS has switched and there is no chance of the database going out of sync, we've been handed members2 which is the table from the original server with the extra data.
Both tables look like this
`idmembers` int(10) unsigned NOT NULL auto_increment,
`firstName` varchar(20) default NOT NULL,
`lastName` varchar(20) default NOT NULL,
`email` varchar(255) default NOT NULL,
`date` varchar(10) default '0',
`source` varchar(50) default 'signup'
PRIMARY KEY (`idmembers`),
UNIQUE KEY `email` (`email`)
So the first table is called members1 and is the live database, which is missing a load of members from members2. I need to merge them both together keeping members1 as it is and allowing unique emails from members2 to be inserted into members1.
I am presuming that there is some SQL to do this but I have no idea what it could be.
My second and less preferable approach would be to use a tool like PhpMyAdmin to export all the records from members2 after a certain date and reimport them into members1 but the problem is they all export from members2 with an idmembers that conflict with members1 (as an autoincrement is used in both)