Duplicate entry when restoring SQL backup

geoffschultz's profile image geoffschultz posted 4 years ago in Import/Export Permalink

I have a database that I want to make a copy of. I export all of the tables as SQL and then import them into a new blank database on the same server. During the import, I receive lots of errors on multiple tables complaining about "Duplicate entry xyz for key 'Primary'. When I look at the tables, I can see that the restored database has tables with fewer rows.

How is this possible since the I'm creating the tables during the import and it has the same structure and data as the original tables? I'm very confused.

-- Geoff

geoffschultz's profile image geoffschultz posted 4 years ago Permalink

Note that the tables use the InnoDB engine.

ansgar's profile image ansgar posted 4 years ago Permalink

I have no clue why that should happen.

I suppose your data contains sensitive information and thus cannot be shared so I can analyze that?

geoffschultz's profile image geoffschultz posted 4 years ago Permalink

Unfortunately it does contain sensitive information. This is for a furniture bank (we provide free furniture and home-goods to people in need) and the database contains client and volunteer information.

-- Geoff

Please login to leave a reply, or register at first.