Resolve ‘Duplicate entry’ error message while importing MySQL database in Plesk

Follow the steps below to resolve the ‘Duplicate entry’ error message that can occur while importing a MySQL database into Plesk.

Stderr is
ERROR 1062 (23000) at line 732 in file: '/var/tmp/pmm-ru-udb-dump-y8polT/backup_sqldump_2400200005_24009010006':
Duplicate entry 'upload_path' for key 'option_name' Last error is Resource temporarily unavailable

  1. Log in to your My Hosting account
  2. Click on Services
  3. Click on the appropriate subscription
  4. Click the Login button on the Plesk control panel
  5. Click on Backup & Restore
  6. To the right of the desired backup, click the green download button
  7. On the next page, enter a password to secure the backup and then click OK to download the backup

The download, depending on your Internet speed and the size of the backup, may take a while. Take this opportunity to prepare your computer to extract .tzst files. On Windows, this can be done with 7-zip. On macOS, you can do this for free with brew & zstd or with an application from the Apple App Store called Keka.

  1. After the download is complete extract the downloaded .tar file
    1. For Windows:
      1. After that file is extracted open the folder that appeared and browse to the databases folder
      2. There may be several folders in the databases folder, open the folder of the database to be imported
      3. Extract the .tzst file with 7-zip and then extract the .tar file as well
    2. For macOS
      1. Open a Terminal window and navigate to the folder that appeared and browse to the databases folder
      2. Extract the database backup using the unzstd *.tzst command
      3. And now browse via Finder to this folder and extract the .tar file as well by double clicking / opening it
  2. The file now extracted is the MySQL database backup and can be opened with a text editor. Open this file with Notepad, Text Editor or Notepad++, for example, but not Word!
  3. Search the file for upload_path , most likely it will be found twice and looks like the following
    ,(48,'upload_path','wp-content/uploads','yes')

    ,(347176,'upload_path','wp-content/uploads','yes')
  4. Delete what was found but leave the one with the lowest digit. In the above example, we leave “48” but remove “347176”. More specifically, in the above example we remove
    ,(347176,'upload_path','wp-content/uploads','yes')
    So including and from the comma to the close parenthesis.
  5. Save the file after making the necessary changes. The file can now be imported!
  6. Follow these instructions to import the file into a MySQL database

 

 

Need help from one of our hosting gurus?

Do you need an urgent answer to a question or help from our support? Our hosting specialists are more than happy to assist you!

Customer Support Team

Our customer service is currently closed. We will reopen on the next working day at 08:30 hour

Of neem een kijkje in onze 'stap-voor-stap' support handleidingen.

View support articles