Hey Chris,
minor nagging at the beginning: it's not a bash script that MySQL Workbench generates, but an SQL script.
For the duplicate records: it's not at the power of MySQL Workbench to prevent insertion of them. It's a feature of the server to reject inserting the same record again (if duplicates are prohibited). What do you suggest? Should WB read 20 million records to find out those that are already there? Wouldn't that be even more time consuming?
You need a different solution if you frequently need to synchronize data between server instances. Read up for replication.
Migration is not a task that do you regularly with the same source and target. Usually it needs some fine tuning at the end is designed to "move over" an instance to a new system and/or host. You won't move your household constantly if you just want to move a cabinet. Migration is not a diff tool at all. Again, replication is the tool of choice for keeping data in synch between server instances.
Mike
Mike Lischke, MySQL Developer Tools
Oracle Corporation
MySQL Workbench on Github:
https://github.com/mysql/mysql-workbench
On Twitter:
https://twitter.com/MySQLWorkbench
On Slack: mysqlcommunity.slack.com (#workbench)
Report bugs to
http://bugs.mysql.com
MySQL documentation can be found here:
http://dev.mysql.com/doc/refman/8.0/en/