How to restore uploaded backup in Drupal 7 (public files or entire website) correctly? When trying to restore public directory I see:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'temporary://cvetmagazin-2016-03-13T16-28-59.tar__0.gz' for key 'uri': INSERT INTO {file_managed} (uid, filename, uri, filemime, filesize, status, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => cvetmagazin-2016-03-13T16-28-59.tar_.gz [:db_insert_placeholder_2] => temporary://cvetmagazin-2016-03-13T16-28-59.tar__0.gz [:db_insert_placeholder_3] => application/octet-stream [:db_insert_placeholder_4] => 166375 [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => 1457901164 ) в функции drupal_write_record() (строка 7316 в файле /home/user/drupal_fish/apps/drupal/htdocs/includes/common.inc).

However, Drupal accepts database dump without errors. How to fix that? Thanks.
I think it's a concurrency issue when D7 makes a file object in db.
try to use this modules Upload QC
please let me know if it works with you.

also try to check the temp file name. and make sure tat the database is restored correctly.