id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,mlocked 4613,Backup database before schema upgrade,sphery ,cpinkham,"The attached patch, mythtv-database_backups_before_upgrade.patch, adds functionality to automatically backup the user's database before a database schema upgrade. Note that the current implementation will /only/ backup the DB if the schema needs to be upgraded. The fact that a backup is being created and its location is written at VB_IMPORTANT level, so it should show in the user's log. Users may define the location for the backups with the specially-named ""DB Backups"" storage group. If there is no ""DB Backups"" storage group, the ""Default"" storage group will be used. If a user upgrades from a version of Myth that did not support StorageGroups, the StorageGroup code will fall back to using the old RecordFilePrefix (the upgrade from 0.20 is untested, but the code in StorageGroup seems to indicate it will work). If the ""DB Backups"" or ""Default"" storage group is used and the user has specified multiple directories in the storage group, the backup will be written to the directory with the most free space. Users who always want the backup written to a specific directory (i.e. to use an external rotation or archiving script) should define a ""DB Backups"" storage group with a single directory. Note that the first backup when upgrading from a version of Myth before storage groups was added (i.e. 0.20) will have to be moved to this directory, then a ""DB Backups"" storage group can be defined for all future backups. The backup filename will use the format --