Page 1 of 1

Copying the database files?

PostPosted: 30. August 2007 19:48
by Gladius
I'm doing some local testing and I was wondering if for backing up only one specific database it'd be enough to just keep a copy of that database's directory & files (from the xampp\mysql\data\ directory) and just restore that whenever I wanted to test with the original database contents again? Basically, I'm wondering if only copying the database files and overwriting all changed files with the original ones when I want to get the initial database contents back would work?

It'd save some time not having to dump and re-import the database every time, but I thought I'd ask here in case this wouldn't work for some reason.

PostPosted: 31. August 2007 04:48
by Smackie
Gladius

If I am understanding you right you want to copy the files from the mysql\data directory say you had a database called main and you copied that file and put it somewhere incase one of your users screws up the text or deleted the members and you didn't want to find the sql's and have to go all the way into the database and insert the whole sql you want to just take that main file and put it into the directory and over write the one that was already there?

well then that will work...

Smackie

(sorry for so sloppy lol i been busy building sites lol and tired of doing things neat lol)

PostPosted: 31. August 2007 15:26
by Gladius
Yea, it's a bit complicated to explain but the idea is very simple; in case something screwed up in the database, I'd just delete the "xyz" database directory (say mysql\data\xyz) and copy the "xyz" directory I've backed up (say, a week ago) in its place.

So you're saying that would work?

PostPosted: 01. September 2007 14:50
by lyntuan
Gladius wrote:Yea, it's a bit complicated to explain but the idea is very simple; in case something screwed up in the database, I'd just delete the "xyz" database directory (say mysql\data\xyz) and copy the "xyz" directory I've backed up (say, a week ago) in its place.

So you're saying that would work?

Sure!

PostPosted: 01. September 2007 15:42
by Gladius
Great, thanks!