PDA

View Full Version : Backing up the database - mysqldump or copy the files?


Slacker
Fri 9th Jan '04, 1:27pm
I was wondering - since I first installed vBulletin on my site (years ago) I've been doing periodic backups of the database using mysqldump. Always works fine. ;)

However - I've only had to restore once, during a server move, and it didn't seem to work to well. I got the sql file moved over and all, created the new DB and tried to import the data. Danged if it didn't take for-freakin-ever! :D

I ended up dumping the search index (on the old server), mysqldumping the data again, and importing that to the DB on the new server. That worked just fine. Next of course was rebuilding the index for a couple of days. ;)

My forum has around 750,000 posts at the moment, and it looks like the search index (assume it's called postindex now in RC2?) takes up about 225 megs of space with about 11,000,000 records. The DB itself is about 750 megs all together.

Is it reasonable to assume that it's not going to be practical to restore a dump of my DB that includes the search index?

My next question: Is it wrong to just copy out the data files for the database to another location on the drive? I don't think I've ever seen this mentioned in the vBulletin documentation, so I've never done it until recently when my server crashed and the data files were all I had to work with. I was able to recreate the DB, copy all the files back in, and chown 'em and after a long long repair (thanks Eva!) everything was good to go. Can I just back the files themselves up everytime instead of doing the dump? I have plenty of space, and it seems like this method would provide a lot quicker restore process.

Thanks for any advice!

rebby
Fri 9th Jan '04, 2:19pm
i think what you want to do is "mysqlhotcopy". that has worked just as easily as "mysqldump" in my past experience.

Steve Machol
Fri 9th Jan '04, 2:22pm
The searchindex table is most likely the largest one you have. It will take a long time to restore.

As far as I know you can copy the db files directly. However you will need to be root to do this and work out the correct permissions. I think you'll also need to already have a db set up.

Slacker
Fri 9th Jan '04, 2:49pm
The searchindex table is most likely the largest one you have. It will take a long time to restore.

Is it called postindex now (RC2)? I would assume you know what you're talking about since you wrote the darn thing, :p but I don't have a searchindex table, and the search seems to be working fine.

Call me confused! :confused: :D

Great work by the way, RC2 is running great on my site. Thanks!