Exporting the BCS Model to an XML file and Importing the updated XML file to SharePoint environment

In this post, I will discuss that how can we export our External Content Type to an XML file and import the same XML file back to our SharePoint environment with any modifications.

I have already discussed in my previous post the steps to create Extenal Content Type using SharePoint Designer 2010. I am using the same ECT(External Content Type ) here.

Before going through the steps, lets discuss What BCS Model is??

So BCS Model is an XML metadata file that contains definitions and details about connection settings, the authentication mode, and available ECTs. A BCS model file is uploaded to the BDC Metadata Store.

Steps to Export the External Content Type to an XML file:

1. Select the External Content Types in left navigation pane in SharePoint Designer 2010.

2. Next, select the ECT which you want to export and  click Export BDC Model in the ribbon.

3. In the Export BDC Model box, specify the BDC Model Name (eg. CustomerDetails) and click OK.

4. Change the Save as type to All Files in the File Save dialog box.

5. Choose a destination folder for the file and change the File Name box to"CustomerDetails.xml".

6. Click Save.

You can edit this XML file i.e. the BDC Model as per your requirements using any XML Editor or SharePoint Designer 2010.

After updating this XML file you can again import this modified BDC Model into your SharePoint environment.

Steps for Importing the updated BDC Model(XML) file to SharePoint:

1.  Navigate to the Business Data Connectivity Service configuration in the Central Administration.

2.  Next, click Import in the BDC Models tab in the ribbon.

Note: Please note that the same BDC Model should not already exist in the store. If that exists, delete that first and then import our BDC Model. If you had to import that same model file again, you would get an error saying that there is a duplicate model, even if you had deleted the ECT. Whenever you are importing the same model a second time, you must delete the model instead of the ECT to avoid that error.
3. In the BDC Model File box in Import BDC Model dialog box, click the Browsebutton to browse for it.

 4. Click the Import button. 

You may see one or two warnings, but there should be no errors.

5. Click OK.

So this is how you can export your BDC(or  BCS) Model to an XML File, update it and import it back into your SharePoint environment with the modifications.


Popular Posts