How to deploy a Master Data Services model

By:   |   Comments (5)   |   Related: > Master Data Services


Problem

In the Master Data Management practice, model sharing is a standard practice within and across organizations as a part of achieving compatibility, standardization and knowledge reuse. Models contain virtually everything from entities to data. Models are often shared in the form of package files which are deployed on the required Master Data Services instance. In this tip, we will look at how to create and deploy a MDS model package file.

Solution

This tip assumes you have at least one model available on your MDS instance. In case you do not, you can easily create a new blank model and then use the same steps explained below.

Creating a model package file using Model Deployment Wizard

One of the easiest ways to create a model package file is by using the Model Deployment Wizard. Open the Master Data Manager web application, and under System Administration | System menu, open Deployment. This should bring up the Model Deployment Wizard as shown in the below screenshot.

Model Deployment Wizard

The Deploy option can be used to select the model of choice and create a package file that contains model objects, but without any data. In this case you would need to have the data included in the package file, the MDSModelDeploy tool should be used.

For the purpose of this exercise, use the Create option and create a package file for any available model. Using the same option, I created a package file called Finance_data.pkg, which I will be using for the purpose of deployment.

Deploying a model package file using MDSModelDeploy tool

One can easily deploy the package file using the Deploy option in the Model Deployment Wizard, but in cases where the packages contain data, and in few other scenarios, one would be mandated to use the MDSModelDeploy tool. So for the purpose of deployment, we will deploy the package that we created in the above section using this command line utility. Follow the steps mentioned below:

The utility can be found in Program Files\Microsoft SQL Server\110\Master Data Services\Configuration directory. Before we execute this, copy the package file that we just created into this directory, to make the command line shorter.

Package and MSDModelDeploy

Under System Administration | Model View, you should be able to find the models available and accessible to you. Make sure that the model you intend to deploy is not already available and deployed.

SQL Server 2012 Master Data Services Model View

Open a command prompt as an administrator and execute the following command. The package name is the name of the package that was created in the above section and model_name is the name of the model that you wish to assign to the model being deployed.

mdsmodeldeploy.exe deploynew -model model_name -package package_name.pkg

If you have the required privileges and the package has been created correctly, it should get deployed smoothly. After successful installation, the command line output should look as shown in the below screenshot.

Command Line Output from the Deployment

If you check the Model View again, you should see the newly deployed model. In case you do not see it deployed, close your browser and then try again.

Deployed Model
Next Steps
  • Explore different options available with the MDSModelDeploy tool.
  • Try different model and package management options available with MDSModelDeploy tool.


sql server categories

sql server webinars

subscribe to mssqltips

sql server tutorials

sql server white papers

next tip



About the author
MSSQLTips author Siddharth Mehta Siddharth Mehta is an Associate Manager with Accenture in the Avanade Division focusing on Business Intelligence.

This author pledges the content of this article is based on professional experience and not AI generated.

View all my tips



Comments For This Article




Wednesday, May 4, 2016 - 9:11:34 AM - Hiren Patel Back To Top (41403)

 Hi Siddharth,

  Sorry forgot to attach the command I am trying to run from PowerShell and error I get when I run from the Octopus server, here it is:

Command:

Set-Location \\ServerName\MDSConfiguration

& '\\ServerName\MDSConfiguration\MDSModelDeploy.exe' deployupdate -package MDSModelDeployCustomer.pkg -service MDS1

 Error:

MDSModelDeploy.exe : 

At line:1 char:1

+ & '\\adsvsql5344\MDSConfiguration\MDSModelDeploy.exe' deployupdate -package MDSM ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:String) [], RemoteException

    + FullyQualifiedErrorId : NativeCommandError

 Unhandled Exception:

 System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.MasterDataServices.Deployment, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system 

cannot find the file specified.

   at Microsoft.MasterDataServices.Deployment.Utility.ModelDeploy.Main(String[] args)

 

Same command runs from the MDS server successfully. Do you think I need to install anything MDS related onto my Octopus server?

Thank you,

Hiren 

 


Wednesday, May 4, 2016 - 8:33:13 AM - Hiren Patel Back To Top (41401)

 Hi Siddharth,

 Thank you for the response Siddharth. Yes, I made sure service account is Admin on the remote box and when i try to access that folder from explorer window i am able to access to shared location on the remote server. When I logged into remote server as service account and ran the command manually and it worked. So not sure why calling same from remote is not working. 

Thank you,

Hiren

 

 

 


Wednesday, May 4, 2016 - 6:40:28 AM - Koen Verbeeck Back To Top (41396)

It's important to notice the difference between deploynew and deployclone in the command line tool.
Deploynew will create new IDs for all of the objects behind the scenes, while deployclone will keep the IDs of the original model.

This is important, because if you want to deploy changes later on to an existing model (e.g. from test to production), the deployment will fail if you used deploynew because it doesn't recognize the IDs.


Monday, May 2, 2016 - 9:05:43 AM - Siddharth Mehta Back To Top (41385)

 Hi Hiren,

It seems like an access issue. First try to manually deploy the model using the steps explained in the tip, just to ensure that the utility is working. If that works, you can try to provide full (admin) rights to the service account and try to deploy the model. If that does not work even with full rights, it may mean that there is some config issue due to which the path is not accessible to the server / script. If this works, then it means that it's just a rights and privileges issue.

I would suggest to debug the issue step by step. Start with a manual approach, then an automated approach. Start the automated approach with full rights and permissions and then start scoping down. Let me know it that worked for you.

 

Regards,

Siddharth


Sunday, May 1, 2016 - 9:41:22 AM - Hiren Patel Back To Top (41375)

 Hi Siddharth,

 Nice article and thank you for the write-up. I have a question about deployment. We are using TeamCity (for build configuration) and Octopus (to deploy the build against targeted server). When i am trying to apply via PowerShell script it keep saying, cannot find MDSModelDeploy file. I made sure the targeted server has MDSModelDeploy utlitiy under C:... drive and i also shared it and gave Octopus service account access to this shared folder, but still no luck.

How could i use MDSModelDeploy utility so that Octopus server can deploy the ".pkg" file to targeted MDS server?

Thank you,

Hiren

 















get free sql tips
agree to terms