Saturday, January 25, 2014

Restoring based on Lync 2013 Backup script. Part 3

Disaster recovery?
Have you tried my Backup Script at the Technet Gallery, but now you're wondering what to do with the backup? How do you restore? What goes where and why?

This is the third of four blog posts trying to explain a couple of concepts regarding backup.

Before reading this post, It is recommend to become familiar with the Basics, CsConfiguration and Topology described in Part 1 as these are the pillars of the deployment. Then also read through Part 2 regarding CsLisConfiguration, RgsConfiguration and UserData.

DialPlan.xml, VoicePolicy.xml, VoiceRoute.xml, PSTNUsage.xml, VoiceConfiguration.xml and TrunkConfiguration.xml
These files are kind of redundant in the backup, as this information is included in the topology and CsConfiguration backups. But after many a hard day in the field, there is no doubt in my mind these files of information can help a technician to quickly identify changes done to a system or reconfigure parts of the voice configuration without restoring the entire system.
Get-CsDialPlan | Export-Clixml -path $backupfile4 
Get-CsVoicePolicy | Export-Clixml -path $backupfile5 
Get-CsVoiceRoute | Export-Clixml -path $backupfile6 
Get-CsPstnUsage | Export-Clixml -path $backupfile7 
Get-CsVoiceConfiguration | Export-Clixml -path $backupfile8 
Get-CsTrunkConfiguration | Export-Clixml -path $backupfile9 
As an example, these files can be referenced in a troubleshooting scenario. Here is a little thing I like to do with the information: Import it into PowerShell then start comparing the information. First import it into a variable, to store it in memory
$ImportForCompare = import-clixml Import-Clixml -Path "C:\Lync backup\VoiceConfiguration.xml
Next we can run a compare statement to see if there is a difference in the live environment and the imported values. For this we can use the "compare-object" like this:
compare-object $ImportForCompare get-csVoiceConfiguration
If there is nothing in return to this command, there is no difference between the two. If there are differences between them, it will most likely tell us there is an item on "each side" not equal to the other. Due to the naming convention within the XML file, it is really hard to tell one line from the other. But at least we know there is a difference and it might be worth looking into it. Next I suggest grabbing the online configuration:
Study the output, then run:
And compare the differences personally. This  can be done with all of the configuration files above. It is also possible to import the files into grid-view, for a more permanent visual reference during a troubleshooting session.

File Backups
File backups are what they are. When a system is restored these are not terribly crucial to restore (in my opinion, that is). As most of the data within the filestore is reproduced during ordinarily restore. This is also why I have chosen to exclude the ABS files and the device store from the backup.
Depending on the switches used when running the backup, the script uses xcopy to back up the filestore. And simply reversing the string will xcopy the data right back.
Xcopy *.* $filepath22 /E /I /Y /H /C | out-null #out-null is used to "silence" the output
ABS Files
The ABS can be recreated by running
Device Updates
Most of your devices should already be up to date if you are restoring a system. Just download the latest device update and add it to the system to provide the latest update to the phones.
Persistant Chat is not included in the topology or csconfiguration, and thus exported separately. It is quite easy to restore the data (once the pools and databases are depolyed). But if there are more than one pool of Persistant Chat, be careful to restore into the correct pool. The backup will store the backup under a folder named by the pool. Restoring should be done by using the Import-CsPersistentChatData command, like this:
Import-CsPersistentChatData -DBInstance\mypreschatinst`
 -FileName “c:\lync backup\"
Stay tuned for the last post on this subject where I will examine certificate export and the database backup.