MySQL help please - Export/Import

optiwebber

Make Money Online
#1
Hello, I've decided to follow the 'Rinse & Repeat' strategy, but would like some help regarding updating via mysql.

I would like to update one site then download the database & upload to the others to save time. However I only want to export certain tables, not the whole DB. Is there an easy route to do this? Any S/W available?

I also need to use the replace string function to change the urls in the new DB file- Does anyone know the correct syntax to use as I used about 5/6 different ones that I found online last night - 1 worked but not sure which one as all gave errors!

Thanks in advance.
 

curb

Make Money Online
Very Active Members
#2
When you're on the Export tab, you'll see the list of tables you can select to export and which ones to ignore.

What does the error say?
 
#3
When you're on the Export tab, you'll see the list of tables you can select to export and which ones to ignore.

What does the error say?
This is the best method if using phpMyAdmin.

Are you using phpMyAdmin? or another sql manager?
 

optiwebber

Make Money Online
#4
Hi :)

Ok I exported the whole database last night to a new site .. Today I updated Site A - Exported only the tables which contain the updates to New site B - Getting the following error:

#1062 - Duplicate entry '5' for key 1

Yes its phpMyAdmin ( but on different servers & different versions).

Just checking site B after the error & there is a problem with the original info ive tried to overwrite.

I'm guessing i need to check/uncheck some options?
 

hollowman

Make Money Online
#5
I think you should be able to use "backup buddy" for that if your using wordpress.
Apparently it will change the urls in the database for you. So you can set up a base site and clone it where ever you want. You could use this for auto blogs or whatever.
 
#7
Hi :)

Ok I exported the whole database last night to a new site .. Today I updated Site A - Exported only the tables which contain the updates to New site B - Getting the following error:

#1062 - Duplicate entry '5' for key 1

Yes its phpMyAdmin ( but on different servers & different versions).

Just checking site B after the error & there is a problem with the original info ive tried to overwrite.

I'm guessing i need to check/uncheck some options?
Are you sure that the DB that your trying to import into is blank? That should be the only reason for a duplicate entry problem.

There's a column in your database that has a unique key defined on it, so any time it see's that data is being entered into that column that is identical to data already in the column, you get that error.
 

optiwebber

Make Money Online
#9
Are you sure that the DB that your trying to import into is blank? That should be the only reason for a duplicate entry problem.
No the DB isnt blank .. I guess I am trying to overwrite the current information with the new file whch has updates to it

Ok edit: solved the problem I checked the drop table box and it looks like its overwrote the tables & added the updates :D

Now just need to chnge the URL's lol
 
#10
No the DB isnt blank .. I guess I am trying to overwrite the current information with the new file whch has updates to it
Yep, it is seeing a duplicate entry, and therefore for giving you a duplicate entry error as at ID 5 there is already data :)

It's best that you just import into a new DB, and then make any changes from there.
 

curb

Make Money Online
Very Active Members
#11
For a quick fix on the URLs, do a offline find and replace URL on a text editor before importing the DB since you're already in the process of doing so.
 

optiwebber

Make Money Online
#12
I think thats probably a lot easier for me Curb, I really don't like doing too much in SQL in case I mess up!

Thanks to everyone for the help.

If anyone knows of a quicker way of updating or any software please let me know :D