• Long story short, I recently regraded a webhosting package from Windows to Linux as WordPress apparently runs better with a Linux package. I am a massive novice, and so have been following tutorials. I downloaded the site I had built on the Windows package according to what I was told, giving me my SQL database and all the wordpress files locally. Had to reinstall WordPress to the domain (obviously) and eventually found out how to restore. Or at least I think this is how to do it.

    Unfortunately, importing my database gives me an error, namely “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” when “Dumping data for table wp_comments“. Any fixes? Or vague ideas? Seriously, I am completely clueless here. Anything is helpful.

    I also have the files ‘logfiles’ and ‘web’ (with all my content inside) which I downloaded via Filezilla. How can I use these? As you can probably tell, the support on my hosting package is dire. If there is a way I can just restore the site using WordPress I’m all ears.

    Thank you so much in advance.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hmm Could it be that existing database have already sample post and sample comment (i.e. when we install WordPress sample comment, post, and page is added.)

    So the error you getting that a comment in wp_comments table already with ID=1 exists.

    Solution I suggest is to drop existing tables in your database, and then do import again.

    However please know that dropping tables and importing from old site, will have everything old site, i.e. username/password also will be which was on old site.

    Thread Starter daisy95

    (@daisy95)

    Thanks Mohsin! That seemed to be the issue, PHPMyAdmin imported it no problem.

    However, when trying to log in to wordpress on my site I get “Error establishing a database connection
    This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at mysql4.clusterdb.net. This could mean your host’s database server is down.”

    I might try and clear cookies but I used the same password for this WordPress install as I did the last one.

    Glad to know that it worked out!

    Please make sure that you have :

    1. Updated Database name, username, and password as per the new server/database in the wp-config.php file

    2. Also mostly database servers have database server as “localhost” but sometime have different url like your error message “mysql4.clusterdb.net” so you need to make sure that database server address is also same and up to date as per new hosting database info

    Thread Starter daisy95

    (@daisy95)

    I hate to be a pestering idiot, but can you expand on these points?

    Am I changing the new database name to the old one I have in the old site files? How would I go about this if so? Or am I editing my old sites wp-config.php local file to the new database name? How would I edit the new database/wp-config file if I haven’t got them downloaded locally?

    I’m assuming I’ll have to contact my service provider regarding database server addresses.

    As I said, complete novice! Thank you so much for your replies so far.

    Sorry for my delayed response.
    Have you got it resolved?

    1. If you moved old WordPress files from old server to new server,
    then you need to edit wp-config.php file using FTP client ( Filezilla will work fine)

    2. Yes, you are editing your old site’s wp-config.php file (which you have already moved to new server as of #1 above) to the new database

    3. Use Filezilla to edit any file on your server

    If you still facing issues, yes asking your hosting provider will be quick and easy.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Errors restoring site using PHPMyAdmin’ is closed to new replies.