Backup MySQL Databases running on a Windows Server using Systems Center Data Protection Manager (DPM) 2012.

, , ,

Running MySQL on a Windows machine is pretty straight forward.  One of the down sides though is that MySQL is not VSS aware and may mis-behave when back up software such as Data Protection Manager or ShadowProtect.  Data Protection Manager (DPM) has the ability (basically called Pre-Backup and Post-Backup Scripts) to perform actions before and after a backup run.

After installing the DPM Protection Agent onto the computer you want to run the protect (by default its %ProgramFiles%\Microsoft Data Protection Manager\DPM) You’ll find a Scripting Folder and inside a ScriptingConfig.xml file which should only contain XML Schema data, we will want to expand on this by adding the following lines inside ScriptConfiguration

   <DatasourceScriptConfig DataSourceName="Data source">
     "Path\Script Parameters"
     "Path\Script Parameters"
     30

DataSourceName needs to be the name of the Data Source that you are protecting (matching in DPM Console) for example C:\MySQL_Backup and in our case we only want to use a PreBackupScript (ie C:\MySQL_Backup\BackupDB.cmd) which will dump a backup from our MySQL Databse into a single SQL file before the actual DPM Backup event.  As an example, the following will execute a backup for MySQL.  You will need to change -User -Password and the MaharaProd to something that suits your environment.

@echo off
set CurrentDate=%date:~-10,2%_%date:~7,2%_%date:~-4,4%
move /y C:\MySQL_Backup\Mahara-*.sql C:\MySQL_Backup\PreviousBackup.sql
mysqldump –user backupuser –password=changethis MaharaProd > C:\MySQL_Backup\Mahara-%CurrentDate%.sql

The above will output a Mahara-DD_MM_YYYY.sql file as well as make a Previous Backup before allowing DPM to go ahead and create the restore point.

Check out this TechNet article for more details on how to get this running.


Leave a Reply

More Posts

PXE Booting with iVentoy for ISO Images and easy OS installs

I have a usb of Ventoy in my everyday carry, it has Windows, Linux and Recovery images and has saved my bacon a number of times over the years. In my lab environment outside of the VM Host it can often be difficult to get exactly what I need loaded quickly, especially when my bag […]

Admin SVC Error when trying to install SharePoint solutions (WSP) and how to fix it

Short and sweet post about deploying SharePoint solutions.  You usually do this by invoking Install-SpSolution under the SharePoint PowerShell, but sometimes you’ll get the following error: Install-SPSolution: Admin SVC must be running in order to create deployment timer job All you need to do is to go to the Services section in Control Panel\System and Security\Administrative Tools […]

How to Switch from IDE to AHCI without repairing/reinstalling Windows

A few weeks ago I installed an SSD drive in my home PC. For some reason up until tonight I never checked what the Sata mode was set to in the bios. It was set to IDE. Usually when changing the storage mode in the bios requires a reformat as windows will no longer boot. […]