0

At our company we have an migration scripts that converts all the old projects into a new relational database.

The migration script is a so called "ugly dragon" written by an colleague that is not working here anymore. It is one big mess written vanilla php with PDO without a exception structure.

No i have the problem that in the old database there are 43.415 records, after the migration there are 43.247 transferred. I know that there are 26 records not migrated because they had a duplicate value for a column that is now indexed as unique.

But the rest of 142 records are a big mystery for us.

Do any of you guys know a way two compare 2 tables in 2 different databases for missing records. There are some columns who stay the same in the new structure where i can query on.

I suck at mysql big time unfortunately, thats why i ask it to you guys.

Thanks in advance!

Edit: Comparing the whole database is not an option because almost everything has a new strucure. Old database was non relational, so for each field we create the relation and insert the fresh created ID. But the code field is a simple integer field with values that stayed the same.

Robert Fridzema
  • 517
  • 3
  • 18
  • Already has a solution into Stack: http://stackoverflow.com/questions/225772/compare-two-mysql-databases – capcj May 12 '17 at 12:06
  • Could you share more information about the database structure? – Vincent Gloaguen May 12 '17 at 12:06
  • You could do a check on the old database for the duplicate value, and then figure out which rows were inserted and which weren't – Florian Humblot May 12 '17 at 12:07
  • That's exactly what i want, but don't know how. I have 2 databases (old / new), in each database we have a table projects with around 40 columns but the field 'code' is in each database exactly the same with the same values. How can i query on this column to see the missing records in the new database/table? – Robert Fridzema May 12 '17 at 12:09

0 Answers0