I was just dumping a database using mysqldump
and I noticed that tables such as cache
(and its cousins cache_page
, cache_menu
, etc), sessions
and watchdog
can be pretty big and are also not often essential for backing up. I mean, when you restore your web site do you really care about restoring people's logged in sessions from when the backup took place? I can understand maybe keeping watchdog; but then again should you lose your site you would probably lose it several hours after the backup so would miss out on any relevant watchdog notices.
Anywho… I did a mysqdump
for a large database for a website I maintain and the dump came out at 400Mb. I then spent a few minutes cobling together a small script which would do a mysqldump
but had some pre-programmed Regular Expressions to match specific groups of tables which it would only dump the structure for (ie, no data). After running this script, the SQL dump was only 220Mb. Much better! It also runs considerable quicker too and will cause less table locking.
So - the script?