-- MokoSuiteBackup 01.39.01 — Uppercase all placeholders in profile data

UPDATE `#__mokosuitebackup_profiles` SET
    `archive_name_format` = REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
        `archive_name_format`,
        '[host]', '[HOST]'),
        '[site_name]', '[SITE_NAME]'),
        '[datetime]', '[DATETIME]'),
        '[date]', '[DATE]'),
        '[time]', '[TIME]'),
        '[year]', '[YEAR]'),
        '[month]', '[MONTH]'),
        '[day]', '[DAY]'),
        '[hour]', '[HOUR]'),
        '[minute]', '[MINUTE]'),
        '[second]', '[SECOND]'),
        '[profile_id]', '[PROFILE_ID]'),
        '[profile_name]', '[PROFILE_NAME]'),
        '[type]', '[TYPE]'),
        '[random]', '[RANDOM]')
WHERE `archive_name_format` REGEXP '\\[[a-z]';

UPDATE `#__mokosuitebackup_profiles` SET
    `backup_dir` = REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
        `backup_dir`,
        '[host]', '[HOST]'),
        '[site_name]', '[SITE_NAME]'),
        '[date]', '[DATE]'),
        '[year]', '[YEAR]'),
        '[month]', '[MONTH]'),
        '[day]', '[DAY]'),
        '[profile_id]', '[PROFILE_ID]'),
        '[profile_name]', '[PROFILE_NAME]')
WHERE `backup_dir` REGEXP '\\[[a-z]';
