SharePoint, Office 365, Azure, and Front end JS geek. – Chicago IL
SharePoint, Office 365, Azure, and Front end JS geek. – Chicago IL

January 2013

Shadow Copy for DEVs (where’s my code!?)

Recently I overwrote an important CS file with an older (bad) copy.  I had no backup copy and I immediately did a face palm.  I could have avoided this with Shadow Copy.

Shadow Copy provides a clean way to view previous versions of the source code files and restore.  Today I added a new drive letter to the VM with Shadow Copy enabled to keep an extra safety net.   Hopefully if I overwrite the file “precious-8-days-of-coding-only-copy-in-the-world.cs” with garbage again then I’ll be able to quickly recover. 

 

1)  Create “code.vhd” from Computer Management

image
image
image

2)  Initialize the disk

image
image

3)  Detach “code.vhd”

image
image

4)  Add new disk to Virtual Machine  (Oracle VirtualBox here)

image

5)  Boot Virtual Machine and create new partition (F:\ here)

image
image

6)  Enable Shadow Copy on the F:\ drive.   I set for every 10 minutes.

image
image
image
image
image

7)  Move “My Documents” to F:\

Detailed instructions can be found here.

 

By moving “My Documents” to the new F:\ drive letter all new Visual Studio and InfoPath projects will be stored here.  Another benefit is I can backup the small “code.vhd” drive more easily than the full VM.  Hopefully this helps someone else avoid a face palm. 

Smile

Two Ways to Check SQL Aliases for SharePoint

Today I was working on a server and wanted to confirm the SQL alias settings were correct.   There are two ways to do this and I wanted to compare both techniques.

 

1 – CLICONFG  (Bad Way)

The old stand-by.   Trusty EXE file names that just work.   Win + R + CLICONFG.EXE is a favorite for keyboard shortcut key gurus. 

image

 

To see 32-bit settings run “%SystemDrive%\Windows\sysWOW64\cliconfg.exe”   Yes, not as easy to type.  

But wait a minute.  Both windows look exactly the same!   Whaaaaat??    That’s no good.  In a world of 32-bit only this worked fine, but things change and our tools should too.

 

image

 

2 – SSMS (Good Way)

I install SQL Server Management Studio (SSMS) on all of my SharePoint web front ends (WFE) for support and troubleshooting.  It’s a great way to confirm the WFE can “see” SQL and connect successfully.   If your organization has a separate DBA team which manages SQL, this is even more helpful because you can look at the databases and run queries even without RDP access to the SQL machines.  Checking storage used, last backup time, and permissions are all helpful read-only tasks we can safely do with SSMS.

With SSMS installed, you get a Start Menu icon for “SQL Server Configuration Manager.”  Launch that and you’ll be able to view aliases for both 32-bit and 64-bit drivers.  You can also run the MSC directly from PowerShell, the command line, or Start > Run.

SQL 2008 R2 SQL 2012
SQLServerManager10.msc SQLServerManager11.msc

Both are in one place!  Clearly labeled and easy to read!   Now that’s much better in a modern 32/64 world.

 

image
image
image

So there you have it.  Two different ways to look at your SQL alias settings. 

As much as I used CLICONFG.EXE over the years, today I use the GUI because it’s a helpful reminder to look at both 32 and 64-bit settings all at once.   Consistency = fewer issues = happy admins. 

Smile

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲