• Moving SharePoint Databases to Another Server (Without Reconfiguring SharePoint)

    Introduction

    Moving / Migrating Microsoft SharePoint Server Databases from one server to another might be difficult as you need to reconfigure all the related DB(s) to point at the new server. This might be acceptable if we are talking about the SharePoint Content Databases, but how about the below scenarios:

     

    Scenario # 1:

    Moving the SharePoint Configuration DB(s) or the SharePoint Service Application DB(s)?

     

    Scenario # 2:

    Lets consider another scenario, where you want to move the SharePoint DB(s) from a Single Standalone SQL Server to a Highly Available Cluster Server, or maybe even configure it to use on of the new features such as SQL Server AlwaysOn.

    Suggested Solution:

    The answer to the above scenarios might not be as straight forward as it seems, as you might need to reconfigure each DB & Service Separately, so how about suggesting the use of SQL Server Aliases as it could be consider a good starting point for both of the above scenario.

     

    Walkthrough Scenario

    To start take a backup of the SharePoint Server DB(s) that you want to move, this can be easily done using Microsoft SQL Server Management Studio. After the backup is complete restore the Database(s) on the new server.

     

    Note:

    • More information about SQL Server DB Backup & Restore can be found here.
    • This approach will not migrate SQL Server other components such as SSRS or SSAS ... etc. however it could be considered a good start to the migration process.
    • After Defining the SQL Sever Alias the Database on the Source Server will not be accessible and can be removed.

    After successfully restoring the SharePoint DB(s) we need to start configuring the SQL Server Alias. To achieve this goal we need to do the following steps on All the SharePoint Servers in the Farm; such as WFE, APPS ...etc.:

    Go to Start >> Run >> Type CliConfg.exe and the below screen will appear:

    Select the Alias Tab and click Add:


    Select TCP/IP from the Network Libraries and Enter the following Values:


    Server Alias: This is the New SQL Server Name Network Name 

    • In Case of SQL Server FCI then this could be the cluster name
    • In Case of SQL Server AlwaysOn AG this could be the SQL Listener Name

    Server Name: This is the Old SQL Server Network Name

    Port Number (if needed)

     

    And that's its, you will see the new SQL Server Alias added as shown and you are ready to start using the new Database.

     


     

    Don't forget to apply these changes to all the SharePoint Servers in the farm. hope you found it useful

     

    Additional References

    Below are some useful references that provides more information about the items mentioned in the above post:

    Creating a SQL Server alias using the SQL Server Client Network Utility

    Plan Your SharePoint Farm Right with a SQL Server Alias

    Create SQL Server Alias – CliConfg.exe

  • VHD Disk Requirements in Windows Azure Pack (WAP)

    There are some prerequisites for VHD Disks that need to be ready before decide to present VHD Disk in WAP to be used why Virtual Machine Provisioning that will save you a lot of troubleshooting time if you verify all as follows:

    1. Library Share that hosts the VHD must be added to the list of Read-Only shares in Cloud Properties in VMM.
    2. The VHD must have “FamilyName” property configured.
    3. The VHD must have “release” property set in the format like n.n.n.n (e.g. 1.0.0.0).
    4. The VHD must have the Operating System property set.
    5. VHD must have the required Tags by Gallery item, the Tags requirements can be found in Gallery item’s readme, this property can be configured only through VMM PowerShell using set-scvirtualharddisk cmdlets, knowing that Data VHD Disk does not require Tag.

    More resources with more details for each step that include videos as well can be found here:

    Troubleshoot Gallery Item:

    http://blogs.technet.com/b/privatecloud/archive/2013/11/27/troubleshooting-windows-azure-pack-and-gallery-items-part-2.aspx

    Troubleshoot WAP:

    http://blogs.technet.com/b/privatecloud/archive/2013/11/08/troubleshooting-windows-azure-pack-spf-amp-vmm.aspx

    Troubleshoot SPF:

    http://blogs.technet.com/b/scvmm/archive/2013/11/12/general-troubleshooting-list-for-windows-azure-pack-wap-and-spf-integration.aspx

    As a conclusion, you should be aware about all the above prerequisites that need to be verified before start testing creating VM using VHD Disk or from Gallery.

  • Using Host Integration Server COBOL Import Wizard

    Introduction

    Host Integration Server allows application integration with the Mainframe system using the Transaction Integrator (TI) component. The method to implement this integration involves building what is called a TI assembly. TI Assembly is actually built using the definition of the interface between the Mainframe program and the definition of the input and output COM areas. This involves in many cases reading large COBOL files and manually adding them to the TI library. The HIS development tools have added the import utility to simplify importing from COBOL copy book files but as we will see in this post this still have many challenges and I will provide in this post a systematic approach to facilitate importing a COBOL copy book file.

    Discussion

    COBOL copy books are the way Mainframe programs define the inputs and outputs. You can think of these as the signature of C# methods. These are mainly text files with specific structure. You can find more details about the definition of the structure of the COBOL copy book files here. A COBOL copy book file would look something like the below:
    clip_image002
    Now usually you would receive two COM area definitions like the above, one for the input COM area and another for the output (if they are different) from the Mainframe team. So the challenge here is how to use the HIS import utility to import these into one method in the TI assembly. Usually when you try to import the import wizard would crash and would not give you enough description of where was the problem so you would end up adding these things manually and that would be ok for smaller programs (like the above) but for more complex programs where you have more than 20-50 fields in input and outputs that would be a very tedious task. The section below would provide a simple approach and walkthrough on how to import these files and use the import wizard successfully every time.

    Solution & Walkthrough

    The HIS import wizard is very sensitive to the spaces and structure of the COBOL copy book file. So for example a following misalignment would fail the import.
    clip_image004
    So the first thing you need to do when dealing with COBOL copy books is to align them perfectly. To do this I recommend using a tool such as Notepad ++ as it understands this type of file and it actually shows you very helpful vertical guidelines.
    clip_image005
    So this simplify spotting misalignments.
    The second thing you need to do is to merge the inputs and outputs COM area definitions in one COBOL copy book file while aligning the outputs as if it is part of the input and I will show you later how these would be separated. Just give it a name with the same program name while adding any suffix such as “-OUT” to it. Please also note that every line has to be terminated with a dot.
    clip_image006
    Now that you have created and saved the COBOL copy book file open Visual Studio and create a new client TI library in a TI project. Now import it as follows:

    1-    
    clip_image007

    2-    
    clip_image009

    3-    
    clip_image010

    4-    
    clip_image012

    5-    
    clip_image013

    6-    
    clip_image014

    7-    
    clip_image016

    8-     Now the method is created as follows:
    clip_image018

     
  • Load testing for WCF service (wsHttpBinding Binding) walkthrough

    In this walkthrough I will perform load testing for WCF service using VS 2012 ultimate version using test environment that consists of one controller and three agent machines, what we will cover in this walkthrough could be summarized into the following:

    • Configure test environment (one controller and three agents)
    • Install VS 2012 controller into controller machine
    • Install VS 2012 Agents into agent’s machines
    • Configure test settings for test project using VS
    • Install add-one for WCF Load Test for VS 2012 from ALM rangers
    • Create and configure Unit test project using VS IDE
    • Create load test project and run the test
    • Analyze the result

    First we will start by downloading the VS test agent and controller update 4 installers located at

    http://www.microsoft.com/en-us/download/confirmation.aspx?id=38186

    image

    image

    The installer consists of two folders and two installer files vstf_testagent.exe and vstf_testcontroller.exe

    First we will begin by Installing and configuring the controller, make sure VS 2012 is installed and running on controller machine, also SQL is needed to store performance data

    image

    image

    After finishing the installation lunch the test controler configuration tool

    image

    Here you have to specify which account to be used with test controller service and load testing database server that will store performance data.

    image

    Now Installing Agent on Agent machines, in our environment we will install it into three machines joined to same controller machine domain.

    image

    Next configure the Agents to connect to controller, in WCF scenario we need to run in as a service as no interaction is needed in load test.

    image

    Then configure the test agent by specifying the account name and the test controller we have created previously , make sure the port 6901 is set in test controller name

    image

    image

    Now after configuring the test Agents and controller we could create load test project using VS 2012 IDE, Create Web performance and Load test project from Test category in new project menu in VS 2012 IDE

    image

    From Load test manage test controllers to make sure all agents are connected and in ready state

    image

    list of agents getting displayed with status for each agent

    image

    To distribute the tests on agents we have to create test settings for load test project to enable remote execution on agents (running tests on Agents instead of controller only (local execution)),this could be accomplished by adding new item to project and choose test setting

    image

    Choose remote execution for test execution method

    image

    In test settings wizard you could specify the host where test will run

    image

    You could change the test time out as well

    image

    Now we will install the Load Tests add-on for VS for WCF, you could download it from URL:

    http://wcfloadtest.codeplex.com/

    After downloading and installing the add-on you could add new item with WCF test template that will start new WCF test generation wizard that will guide you to log the WCF call and save it as unit test

    image

    First you have to include the executable that calls the web service , in our case we developed a WPF application that calls the service

    image

    After calling the service from the executable the SOAP call is recorded as shown below

    image

    After the wizard is complete two CS files is added to your project

    image

    in next post we will proceed with configuring the WCF unit test and the remaining steps to perform the load test

  • Host Integration Server 2013 TI Assembly GAC deployment Walkthrough

    Introduction

    Host Integration Server (HIS) is used to integrate with Legacy Host technology. One of the Host integration scenarios is to call Mainframe programs or transactions using a component in HIS called Transaction Integrator (TI). The way to use TI is to create what is called a TI assembly and then use this to call the Host systems from the Windows System. The TI assembly can be either used in a folder or deployed to the Global Assembly Cache (GAC). I wanted to deploy the assembly to the GAC to make sure it is available from anywhere in the integration solution and because I had strong named assemblies in the solution that required to reference this assembly. This blog post will provide the challenge and problems faced while trying to do this and how these were resolved to finally deploy the TI assembly to the GAC and use it from there in a BizTalk solution.

    Discussion

    Host Integration Server (HIS) is used to integrate with Legacy Host technology. One of the Host integration scenarios is to call Mainframe programs or transactions using a component in HIS called Transaction Integrator (TI). TI technology has been around for a while (it was used to be called COMTI) but it went through many changes and updates. In HIS 2013 the TI component undergone major changes. There are two scenarios to use the TI, either Host Initiated Processing (HIP) where the call is initiated from the Host server to the Windows server, in this scenario the Windows server acts as the backend and the Host is acting as the channel or initiating system. The other scenario is Windows Initiated Processing (WIP) where the call is initiated from the Windows platform and it is routed to the Host system. The diagram below illustrates this scenario.
    clip_image002

    Figure 1: Windows Initiated Processing Scenario

    To be able to implement a WIP scenario you need to implement what is called a TI assembly. This assembly actually governs the interface and mapping of parameters between the Windows system and the Host system. The way you create this assembly (as this is a special assembly type) is using the TI project template that ships with the HIS 2013. I am not going to describe how to create the TI assembly as you can find many references on how to do this in the HIS 2013 SDK here and on MSDN here.
    Once you have created the TI assembly you will have the following view in VS 2012.
    clip_image004

    Figure 2: TI Assembly in VS 2012

    Now to be able to deploy an assembly in the GAC you need to have that assembly signed with a key and then would have a strong name. If you click on the Library node (root node in the above figure) and check the properties you will see that it has the following properties:
    clip_image006

    Figure 3: TI Library Properties

    The property I am interested in is the KeyFile property which is according to the documentation if you provide a Key file in this property then the generated assembly would be signed with this key and would have a strong name (sweet). Unfortunately for some reason this does not work as expected and I could not get it to work and the assembly generated is always not signed.
    I have investigated many other options to sign the assembly after being compiled and this is doable but I wanted something more streamed and easier to be done if I needed to re-generate the assembly.
    Once I signed the assembly (as I will show you in the next section) and GACed it. When I create a BizTalk port using the BAHA adapter and try to configure it with the GACed assembly I found that the dialog to select the assembly from the GAC is always empty!  As per the below figure.
    clip_image007

    Figure 4: Select Assembly from GAC form

    The way to resolve also this issue and finally to configure the GACed assembly will be also presented in the following section.

    Solution & Walkthrough

    So let’s get to the way to get this working. The steps are as follows:

    Part 1: GAC the TI Assembly

    1-     Create the TI Assembly as you need and configure the calling model of the assembly to be “DirectCall, WCF, WS, BAHA”
    clip_image009

    2-     Now in the same properties make sure you have set the Debug property to “True”
    clip_image011

    3-     Now save the TI assembly and you will find the following are the generated artifacts in the output folder:
    clip_image013

    4-     Now take notice of the generated CS file marked above. Now create a new class library project and name it as you see fit. In that Class library project make sure that the .NET version is set to 4.0 at least (as HIS 2013 is upgraded to .Net 4.0) and then add the generated CS file to that project ( you might even add it as a link to make sure if the CS file is re-generated it is automatically updated in the class library project)
    clip_image015

    5-     Now make sure you add the following line to the AssemblyInfo.cs
    [assembly: System.CLSCompliant(true)]

    6-     Now go to the properties of the class library and make this library a signed library as you do with any C# library
    clip_image016

    7-     Add references to the following assemblies:
    clip_image018
    C:\Program Files\Microsoft Host Integration Server 2013\system\Microsoft.HostIntegration.TI.ClientContext.dll
    C:\Program Files\Microsoft Host Integration Server 2013\system\Microsoft.HostIntegration.TI.TBGen.dll
    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.ServiceModel.dll
    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.Services.dll

    8-     Now build the assembly it should build successfully and then add it to the GAC using Gacutil.exe as you would do with any other assembly. The TI assembly is now GACed and ready to be used.

    Part 2: Use the GACed TI assembly from BizTalk

    1-     Since the TI assembly is a .Net 4.0 assembly it will be GACed in the .Net 4.0 GAC and hence will require the .Net 4.0 Gacutil to be handled. Which comes installed with VS 2012.

    2-     Now for some reason the HIS HostApps adapter is not linked correctly to the VS2012 installation folder and hence I had to change things a little to make sure it is able to see the TI assembly in the GAC.

    3-     Open the Regedit application and browse to the path “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework”

    4-     Add a new string value with the name “sdkInstallRootv2.0” and set the value of this string to “C:\Gacutil4”

    5-     Now open the .net 4.0 tools folder “C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools” and copy all the contents of this folder to the folder “C:\Gacutil4\Bin” (just create this folder).

    6-     Now open the BizTalk administration console.

    7-     Create a new send port in BizTalk

    8-     Select the HostApps as the adapter and then click configure and configure the connection string
    clip_image020

    9-     Now click add and then add assemblies (GAC) option
    clip_image021

    10-  Now you will see all assemblies installed in the .Net 4.0 GAC and you can select your TI assembly that you installed in Part 1 above
    clip_image022

    11-  Now complete the configuration as usual and click ok to configure the send port
    clip_image024

    12-  Now if you check the connection string created and compaire the TI GACed assembly with a normal one you will find this as below:

    <?xml version="1.0" encoding="utf-8"?>
    <mappings>
      <mapping>
        <assembly><![CDATA[C:\Program Files\Microsoft Host Integration Server 2013 SDK v1.0\ApplicationIntegration\WindowsInitiated\InstallationVerification\TiHostDefinitions\NetClnt1\bin\NetClnt1.DLL]]></assembly>
        <connectionString><![CDATA[CodePage=37;Name=TrmLink;TimeOut=0;SecurityFromClientContext=False;IPAddress=127.0.0.1;TCPPorts=7510;ConcurrentServerTransactionId=MSCS]]></connectionString>
      </mapping>
      <mapping>
        <assembly><![CDATA[MCS.Test.TI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=2b679cb5291d11c2, processorArchitecture=MSIL]]></assembly>
        <connectionString><![CDATA[CodePage=37;Name=TrmLink;TimeOut=0;SecurityFromClientContext=False;IPAddress=127.0.0.1;TCPPorts=7510;ConcurrentServerTransactionId=MSCS]]></connectionString>
      </mapping>
    </mappings>

    13-  Now you can use this send port normally.

    Conclusion

    The HIS 2013 TI assembly can be installed in the GAC to simplify your deployment configuration. The walkthrough provided above can be used on the development machine to be able to configure the solution and build it but on the production environment no changes are required at all.