Monday, 29 April 2013

Export/Import SharePoint Terms Store using PowerShell Commands


Export-SPTerms and Import-SPTerms:
Exporting and importing spterms needs extra cmdlets, for getting extra set of cmdlets you will deploy wsp file into your sharepoint environement. You can get wsp file from
http://www.thelapointes.com/blog/Lapointe.SharePoint2010.Automation.wsp
After deploying wsp file , verify cmdlets added or not
  • Go to Sharepoint management console
  • Type Export-SPTerms (or) Import-SPTerms if your asked for any information then your cmdlets if you get error terms cmdlets are not added.
For exporting the spterms excute following command :

Export-SPTerms -TaxonomySession "Central admin url" -OutputFile "Your xml file path"
Ex:Export-SPTerms -TaxonomySession "http://myadmin:2324/" -OutputFile "c:\terms.xml"
This will export spterms to xml file you have mentioned.

For importing spterms(collected from other source) from xml :
Before import you just need change 3-parameters in the source xml provided.Theyare
  1. Open the source xml, in that node(Termstore under the node Termstores) has name attribute, the name attribute value and your local Managed metada source must be same.If not change it as per your local term store name
  2. Change Id attribute and give the id of your local Termstore
  3. Change SystemGroup attribute value to your local system group
Ex : <TermStore Name="Your local Metadata Service" Id="Local store id guid" IsOnline="True" WorkingLanguage="1033" DefaultLanguage="1033" SystemGroup="local store system group id">

Note: Above 3-steps you can easily do by exporting your local terms to xml and from the resulted xml copy all these 3-attributes.

And also change the user field values in the source xml to your local users(in the store system where your exporting)

No comments:

Post a Comment