A little while I recorded a. screencast on how you can create a BCS Application Model. Well, in this post I would like to show you how to import this model over to the SharePoint environment, both using UI and with the script.
As you know, the model is just XML file that defines where the data comes from and in which form.
One of the way to import it is this:
1. Go to Central Administration -> Service Applications:
http://[central admin url]/_admin/ServiceApplications.aspx
2. Click on Business Data Connectivity
4. The just pick a model you have created and exported from SharePoint Designer (for that matter) and import it.
it. Of course if you`re deploying from one server to another – you would be more interested in a Power Shell script that does the import.
Here is one script you can use:
$serviceContext = Get-SPSiteAdministration -Identity $SiteUrl
Write-Host “Connecting to DBC”
$bdc = Get-SPBusinessDataCatalogMetadataObject -BdcObjectType Catalog -ServiceContext $serviceContext
Write-Host “Importing ..”
Import-SPBusinessDataCatalogModel -Identity $bdc -Path “.\MyModelExport.xml” -force -ModelsIncluded -PropertiesIncluded -PermissionsIncluded -Verbose -ErrorAction Stop -ErrorVariable $err
ABove, we `re getting a hold of a BCS service application and performing import with some of the keys such as PermissionsIncluded and PropertiesIncluded just like in the UI.
Check our more information on some of the import parameters and commands you can use on here.