Welcome to WebmasterWorld Guest from 54.146.211.105

Forum Moderators: open

Message Too Old, No Replies

Easy way restoring a database

is there a painless way to do it?

     
10:50 am on Jun 24, 2006 (gmt 0)

New User

10+ Year Member

joined:Dec 14, 2004
posts:11
votes: 0


I was wondering if there are people here who know about restoring databases, in an easy way.
For example, i have a forum database which has to be restored, but it can't be done all the sql file at once, i have to break it into dozen of pieces, and it takes a lot of time

How do you restore your database?

12:00 pm on June 24, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 13, 2004
posts:1425
votes: 0


This may sound dumb, and possibly is, but my first thought is:
BACK UP EVERYTHING, multiple times, and do that first.
The rest is details. -Larry
12:39 pm on June 24, 2006 (gmt 0)

New User

10+ Year Member

joined:Dec 14, 2004
posts:11
votes: 0


oh, no no no :) this is not what i meant :)
I know the steps, i did many restores by now, i just want to know if there is any easy way to be done. Any specific tools to be used. For example, all of you use the phpMyAdmin interface for restores?
1:02 pm on June 24, 2006 (gmt 0)

Moderator from GB 

WebmasterWorld Administrator mack is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:June 15, 2001
posts:7583
votes: 11


If you have a backup in sql format you can just use the "sql" tab in phpmyadmin and paste your sql in there. It will then populate the database for you with the existing data.

Try this on another database first so you can test the data before using it on a live database.

Mack.

9:10 am on June 25, 2006 (gmt 0)

New User

10+ Year Member

joined:Dec 14, 2004
posts:11
votes: 0


problem is that the sql is file very big and it doesn't work this way. is the backup of a phpbb with ~ 25,000 posts
9:14 am on June 25, 2006 (gmt 0)

Moderator from GB 

WebmasterWorld Administrator mack is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:June 15, 2001
posts:7583
votes: 11


Ahh yea there is a limit on file size within phpmyadmin.

You might be able to use mysql administrator. It's a free download from the mysql website.

If that fails you might want to have a look into "mysql dump".

Mack.

9:33 am on June 25, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:Oct 30, 2000
posts:497
votes: 0


[webmasterworld.com...] the big dump script works a treat.
5:56 am on June 28, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 27, 2001
posts:2548
votes: 0


If you know how to SSH in with, for example, putty you can do (to back it up):

$mysqldump -uname -ppass --opt dbname > dbname.sql
then you can zip it, scp it to your home computer, whatever.

Then to restore:
$mysql dbname < dbname.sql

There is no limit on file size with this method (unless you're approaching the 2GB limit of some linux operating systems).