Friday, October 4, 2013

Support Documentation for SP 2013 for Term Set Exporter App

App Name
Term Set Exporter App

Short Description
Client based solution to export Term Sets and Terms from Taxonomy Term Store to an XML File

Long Description
Often times we have a need to export term sets and the terms (and their children) from our Taxonomy Term Store of the Managed Metadata Service, after defining them in an environment. We often need to get the GUIDs of the terms / term sets, in addition to their display name. This becomes essential because, Share Point defines a new GUID for every term / term set when you create them through UI or even when you create them through Power Shell without explicitly specifying the GUIDs for the terms or the term sets.You might find a lot of tools out there (even in Code Plex), which already do this, in a sophisticated way, with much more details. But unfortunately, most of them need to be run from the server. In many cases, we may have to extract this information from certain environments, to which we may not have access and not necessarily from Development environment, all the time. Moreover, it would be really nice, if we can maintain the hierarchy while exporting and export it as an XML file, so that it can be converted to any desired format (say, Excel). The exported data can then be used to recreate the taxonomy terms in any other environment, which will ensure that all environments will have the same GUIDs for the terms / term sets. Though there are many tools out there, all of them are server based. They need to be run from within the Share Point Server. Many times, this may not be possible. This arises the need to have a client based solution, which can extract and export this information. This tool exactly addresses these issues. The following are the prerequisites.
1. Please ensure the managed metadata service is running and a term store is created and term sets and terms are properly defined.
2. Please ensure the site has taxonomy site columns connected to the term store, from where you want to export the information.
3. The app should be installed only on sites which satisfy condition 1 above. Otherwise, it will show a message to the answer.
4. Please ensure, the user has write access on the host web, since it creates a file in the Site Assets library.
5. Please ensure the Host Web has a Site Assets library.
6. Please ensure the taxonomy site columns are grouped together into a single group, so that the term sets and terms are exported into a single xml file with proper hierarchy.

Testing Notes
1. In the Central Administration Site of your Share Point environment, please ensure the Managed Metadata Service is running and it is connected to a Content Type Hub site. If not, please start it and make sure it is connected properly to the Content Type Hub site. Please ensure the Content Type Hub site also exists. If it doesn't exist already, create one (Team site) and activate the Content Hub feature.
2. Please define some term sets and terms. Make sure, at least, some of the terms and their children are hierarchical.
3. In a Team Site (for this example, you can use the Content Type Hub site itself), create some site columns of type Managed Metadata and associate them with the newly created term sets and group them with a new group called "CustomTaxonomyColumns".
4. Ensure there is a Site Assets library in the site and the user running the app has write privileges on the host web, since the exported term set xml file will be uploaded to the Site Assets library.
5. Upload the app (.app file) to the App Catalog, add and trust the App.
6. In the App Home page, there will be a textbox next to a label which says "Enter Site Column Group Name:" and a button. Provide the name of the Site Column Group Name which has taxonomy columns in it. In our case, it will be "CustomTaxonomyColumns".
7. Click on the Generate button and you might see a message saying please wait (depending on the network speed. For very good speeds, the XML will get generated in no time.) and there will be text below the button, saying "TermSets Exported Successfully. Click on the ExportedTermSets.xml to open/save the file."
8. Click on the hyperlink "ExportedTermSets.xml" (will be blue and underlined) to open or save the file to disk. Alternatively, navigate to the Site Assets library to download / open the file.
9. If you click on the Generate button with site column group name text box blank, then you will see an alert "Please enter a valid Site Column Group Name." and the focus will be reset to the textbox to help the user enter the value.
10. If you enter an incorrect site column group name and click on Generate button, then also, the user will get an alert saying "No taxonomy columns found in the site for the given Site Column Group. Please check the Site Column Group Name or use a valid site with Taxonomy Columns." and the current text in the text box will be selected to enable the user to enter the correct value.

The following screen shots below show the steps in detail, in sequence.

Note: Please ensure the Managed Metadata Service is up and running. This is a mandatory prerequisite for the remaining conditions to satisfy. Also, obviously, this app will work only in Share Point 2013.

1. Please ensure the term sets and terms (preferably hierarchical) are present in the Taxonomy Term Store, as shown below.
 In the site (Team Site), create site columns of type Managed Metadata, as shown below.

 The following screen shot shows the site columns of Managed Metadata type created in the site.

 The following screen shot shows the screen which will prompt you whether you want to trust the app or not and also, what level of access is required by the app. Please ensure to click on "Trust It" button. :)

 The following screen shot shows how the app will appear on the Site Contents page.

 The following screen shot shows how the app will look like.
 The following screen shot shows the app along with its output.

The following screen shot shows the ExportedTermSets.xml in the Site Assets library
The following screen shot shows the exported term sets xml file.

Please leave your comments here. For support, please reach out to me at