Importing WordPress database (phpMyAdmin)

Associate
Joined
11 Apr 2007
Posts
337
I've been tring to import a database from one site to another but I keep getting errors. I'm new to this procedure so might be missing something fundamental.

I've exported the sql db leaving everything at defaults but maybe there is a setting here I don't understand that is causing issues.

The errors are always 'dupicate entry' related... This is the last one:

#1062 - Duplicate entry '1' for key 1

Any thoughts appreciated...
 
ok, got it working, but I had to drop all the tables on the DB I was importing into.

Yeh, if you backup a MySQL database how I think you are then it will usually include all of the table creation etc. That's why it doesn't like it when it finds existing information on the import. Although, that's not exactly the error you were getting, but its fixed now so never mind!
 
Remember that if your domain has changed you need to edit all the static links the wordpress editor has added.

Either write a bit of SQL to update, or do a mass find and replace on the sql in notepad++ or something.
 
Yeh, if you backup a MySQL database how I think you are then it will usually include all of the table creation etc. That's why it doesn't like it when it finds existing information on the import. Although, that's not exactly the error you were getting, but its fixed now so never mind!

In this case I was just importing to a new WordPress installation to create a duplicate preview site for a client so dropping the DB wasn't an issue as there was nothing in it.

Is there anyway to import a DB but ensure it overwrites any existing tables & info? I always imagined thats how it worked, you import one which overwrites the other... Maybe its not as simple as that.

Remember that if your domain has changed you need to edit all the static links the wordpress editor has added.

Either write a bit of SQL to update, or do a mass find and replace on the sql in notepad++ or something.

Yeah, sussed that but I did it by hand as I couldn't figure out how to do a find and replace! :rolleyes:

There's a plugin that does, blue velvet or something it's called.

Thanks, I'll definately be looking into that.
 
Back
Top Bottom