How to insert multiple tables into their respective backup tables using insert sql? For the purpose of backup and restore i want few tables to be just backup  while performing a restore process. I have created backup tables but now whenever i do restore process it shows:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062      Duplicate entry '1' for key 'PRIMARY':


Actually both tables have same schema and same primary key so whenever it try to update it there is conflict.
Can anyone please tell me how to do it ?
One more thing can i use drupal Features to do it and if yes please let me how.
You should use
Merge Queries

a Merge query is a combination of an Insert query and an Update query.
If a given condition is met, such as a row with a given primary key
already existing, then an Update query is run. If not, an Insert query
is run.

The above is for drupal
If you are using mysql then you can use UPDATE or ON DUPLICATE KEY UPDATE