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

Karl Newman newmank1 at asme.org
Thu Jan 2 18:50:18 UTC 2014


On Thu, Jan 2, 2014 at 8:09 AM, Jeff Breitner <jtbreitner.lists at gmail.com>wrote:

>
>
>
>
>>>> No, please don't do this. 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 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?

Karl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20140102/32df8501/attachment.html>


More information about the mythtv-users mailing list