[mythtv-users] REMINDER: Back Up Your Database.

Paul Gardiner lists at glidos.net
Thu Jan 2 19:46:58 UTC 2014


On 02/01/2014 18:50, Karl Newman wrote:
> On Thu, Jan 2, 2014 at 8:09 AM, Jeff Breitner
> <jtbreitner.lists at gmail.com <mailto:jtbreitner.lists at gmail.com>> wrote:
>
>
>
>
>
>                 No, please don't do this. mythconverg_backup.pl
>                 <http://mythconverg_backup.pl> uses specific
>
>             command-line arguments to mysqldump to prevent a corrupted
>             backup (or
>             restore). That's why the script was created--for a reliable,
>             supported
>             method of backup and restore.
>
>
>         Exactly.  The given mysqldump command line /will/ create a
>         backup with a corrupt schema, so if you ever restored that
>         backup, you will have a corrupt schema (which could break
>         functionality of the running system and/or prevent proper
>         upgrades of the database in the future).
>
>         Mike
>
>
>     Karl, Mike...
>
>     I have used that method to bounce between very diverse releases on
>     my dev systems without any incident.  Countless times.  And if there
>     ever was an opportunity to have schema problems, that would be it.
>
>     Care to elaborate on the schema differences?
>
>     There is an caveat in my ad-hoc bash script however, probably should
>     consider --lock-tables if dumping a live system.
>
>
> I think character set is one big potential issue. The command-line
> arguments in mythconverg_backup.pl <http://mythconverg_backup.pl>
> include these switches at a minimum:  --add-drop-table --add-locks
> --allow-keywords --complete-insert --extended-insert --lock-tables
> --no-create-db --quick --add-drop-table (Hmm... I see that
> --add-drop-table is in there twice). Note however, that the man page for
> mysqldump says "Use of --opt is the same as specifying --add-drop-table,
> --add-locks, --create-options, --disable-keys, --extended-insert,
> --lock-tables, --quick, and --set-charset. All of the options that --opt
> stands for also are on by default because --opt is on by default."
> There's a fair (but not complete) overlap between these command-line
> options so maybe the default mysqldump is close enough (and you didn't
> have any special-case data) that you lucked out. But it's still not
> recommended, and why would you do it the manual way, when there's a very
> nice, supported script which automatically creates backups with good
> filenames and auto-rotates the backups?

The reason I use mysqldump is because it allows me to backup or
transfer between machines all my databases, not just mythconverg,
in one simple command. Probably if I was about to do so for the first
time now, knowing the recommendation, I'd use mythconverg_backup for
just that one database, but given my mythconverg has been through
the mysqldump process many times, including one time that swapped
from MySQL to Maria without my realising, I don't imagine I'd gain much
safety in moving to mythconverg_backup now.

P.


More information about the mythtv-users mailing list