Nikolai
Nikolai

Reputation: 195

Mysql db restore

I have a problem with restoring a db. I'm writing some tests for a php script. Tests add much data to different MYSQL db tables, especially when I debug them (tests), then I have to quickly restore the previous version of the db and run the tests again, but it's a long process to restore the dump. When the db size is 25 mb it takes almost 1 min, it's fine, I can wait 1 minute, it's not good but ok, but if the db is more than 2 gb it takes too long.

Maybe you know of any fast methods to restore a db or dump or log changes then revert them. My tests change only a few tables, but each time the changed tables are different and I can't know from test which tables were changed.

-- ADDED -- I need full a backup or a method to know what was changed because I don't know which tables were changed.

I make a full SQL dump and then simply restore it with mysqldump --- ADDED -- My DB is using MYISAM

Upvotes: 1

Views: 72

Answers (1)

Rahul
Rahul

Reputation: 77866

Not sure, how you are taking backup but looks like you don't need a full backup. Rather, take a differential or incremental backup and restore the same. Which will be much faster than a full backup restore. See Mysql documentation on Restoring an Incremental Backup for more information

Upvotes: 2

Related Questions