Restoring a mysql database from a backup

Discussion in 'Site & Server Administration' started by glhawk, Aug 27, 2010.

  1. #1
    Ok, I wanted to do a clean install of a commerce plugin, from a wordpress website I was working. Something happened with the database and messed up the website pretty bad. I had backed it up before, and was wondering how to restore my backup file.

    I uninstalled wordpress from the original database, deleted all the files, and removed the domain name from the server.

    I then, re-added the domain name to the server, added a new database, and went to phpmyadmin. I chose the database I created, and clicked on the import tab on the top and imported my backup file (.sql file). Now I see everything in my database again, but how do I get the website to show up?? There is nothing in my ftp for my website except the cgi-bin file.
     
    glhawk, Aug 27, 2010 IP
  2. instant87

    instant87 Active Member

    Messages:
    626
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    80
    #2
    Did you re-upload the script? The order I do it is.. backup the database... delete everything (files & database)... install the script normally on the new server... logon to phpmyadmin... connect to the new script's database... delete everything... restore your backup database.

    That way, you don't have to worry about editing any config files in the script.
     
    instant87, Aug 27, 2010 IP
  3. glhawk

    glhawk Peon

    Messages:
    52
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I'm sorry, I'm not following you when you say re-upload the script. Do you mean addon my domain, and re-install wordpress? and then restore the database in phpmyadmin?
     
    glhawk, Aug 27, 2010 IP
  4. instant87

    instant87 Active Member

    Messages:
    626
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    80
    #4
    Right... install wordpress on the fresh server, then logon to phpmyadmin, delete everything, and restore. Since you're using wordpress, you could also do it the other way... create a fresh database with the backup, then install the script and edit the wp-config.php file to point to the new database.
     
    instant87, Aug 27, 2010 IP
  5. glhawk

    glhawk Peon

    Messages:
    52
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Alright, that worked just fine, thanks for the help. Although non of my images saved .. :( bummer, I guess I have to get back to work.
     
    glhawk, Aug 27, 2010 IP
  6. Shagoon

    Shagoon Notable Member

    Messages:
    596
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    220
    #6
    The following actions were really not needed, and they created more problems than they "solved":
    "I uninstalled wordpress from the original database, deleted all the files, and removed the domain name from the server."

    If you mess up your database, all you need to do is restore it from your backup, no need to uninstall wordpress, delete all files, remove domain from server...
     
    Shagoon, Aug 28, 2010 IP
  7. RectangleMan

    RectangleMan Notable Member

    Messages:
    2,825
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    210
    #7
    That's like removing a tire in a car to change the oil. You dun screwd up!
     
    RectangleMan, Aug 28, 2010 IP
  8. instant87

    instant87 Active Member

    Messages:
    626
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    80
    #8
    That's because the images aren't stored in the database, they're stored in the actual folders. If you have a backup of the files, you can pull them out from there and upload them to the new site.
     
    instant87, Aug 28, 2010 IP
  9. glhawk

    glhawk Peon

    Messages:
    52
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    alright thanks everyone for the responses. I have restored it successfully and re-up'd all the images etc..

    Is there a way where I can easily just backup the whole database without having to ever re-up all the images again?
     
    glhawk, Sep 10, 2010 IP
  10. i97

    i97 Greenhorn

    Messages:
    95
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    18
    #10
    No.I think images are not stored in the database.So you will have to backup the images folder separately
     
    i97, Sep 10, 2010 IP