MySQL help please - Export/Import

Discussion in 'SQL' started by optiwebber, Apr 16, 2010.

  1. optiwebber

    optiwebber Make Money Online

    Joined:
    Apr 1, 2010
    Messages:
    1,515
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    UK
    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.
     
  2. curb

    curb Make Money Online Very Active Members

    Joined:
    Dec 17, 2009
    Messages:
    112
    Likes Received:
    2
    Trophy Points:
    0
    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. sf

    sf Busy

    Joined:
    Dec 15, 2008
    Messages:
    789
    Likes Received:
    32
    Trophy Points:
    0
    This is the best method if using phpMyAdmin.

    Are you using phpMyAdmin? or another sql manager?
     
  4. optiwebber

    optiwebber Make Money Online

    Joined:
    Apr 1, 2010
    Messages:
    1,515
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    UK
    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?
     
  5. hollowman

    hollowman Make Money Online

    Joined:
    Oct 27, 2009
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Blue Borough
    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.
     
  6. optiwebber

    optiwebber Make Money Online

    Joined:
    Apr 1, 2010
    Messages:
    1,515
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    UK
    Hi hollowman - It's a video cms not WP.
     
  7. sf

    sf Busy

    Joined:
    Dec 15, 2008
    Messages:
    789
    Likes Received:
    32
    Trophy Points:
    0
    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.

     
  8. hollowman

    hollowman Make Money Online

    Joined:
    Oct 27, 2009
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Blue Borough
    I'm not sure then mate...I would just use php admin then.
    With the duplicate entry that's got to be what sf said.

    tks
     
  9. optiwebber

    optiwebber Make Money Online

    Joined:
    Apr 1, 2010
    Messages:
    1,515
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    UK
    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. sf

    sf Busy

    Joined:
    Dec 15, 2008
    Messages:
    789
    Likes Received:
    32
    Trophy Points:
    0
    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.
     
  11. curb

    curb Make Money Online Very Active Members

    Joined:
    Dec 17, 2009
    Messages:
    112
    Likes Received:
    2
    Trophy Points:
    0
    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.
     
  12. optiwebber

    optiwebber Make Money Online

    Joined:
    Apr 1, 2010
    Messages:
    1,515
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    UK
    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
     

Share This Page