Monday, 20 July 2015

Change the location of the Azure Backup Agent Scratch / Cache folder (without reinstalling)

So far Azure Backup is great, but it has a couple of shortcomings:


There's the issue with passphrases; if you lose this text-file based passphrase created at startup, any and all data you've backed up to Azure becomes unrecoverable.


The major one for me ended up being the cache /scratch location. This is, by default, stored here:  %ProgramFiles%\Microsoft Azure Recovery Services Agent\Scratch\.


The scratch location requires 10-15% of the total data set you are backing up to Azure... So when backing up large data sets, you're in danger of running out of free space on your system drive, which is exactly what happened to me.


No fear, I said. I'll just adjust the location of the scratch folder in the GUI.


There is no option to change this location in the GUI.


Oh well, <rolls up sleeves> the Powershell cmd set will have what I'm looking for.....


Nope..


The only TechNet post I found, had the solution as reinstalling the agent. I thought there had to be a better way.


I went searching the reg for the location and found it under HKLM\Software\Microsoft\Windows Azure Backup\Config\ScratchLocation.


I thought I'd better get hold of @AzureSupport to confirm the official approach. They advised the following:


1. Run up an elevated Command Prompt, and stop the engine service:


Net stop obengine


2. Copy the scratch folder (default path is %ProgramFiles%\Microsoft Azure Recovery Services Agent\Scratch\) to the new desired location.


3. Update the following registry entries with the new path to the scratch folder:


[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Azure Backup\Config\ScratchLocation]


[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Azure Backup\Config\CloudBackupProvider]  (this key is optional and only required to be changed if already present)


4. Run up an elevated Command Prompt and start the engine :


Net start obengine


And you should be good to go!


I've requested this is added to the cmdlets for Powershell for Windows Azure Backup..


HTH someone....