views:

282

answers:

1

Hi,

  1. Is it possible to import managed keywords into SharePoint 2010?
  2. Where are the keywords stored within which database?

  • Background - I'm currently working on a migration from a legacy system into SharePoint 2010. So far everything is going well, and I can even bring across the managed meta data across along with most other data.

The process I use was built for SharePoint 2007 to update Lists over SOAP. With a few manual tweaks I've managed to get the metadata to come across.

To bring across either managed metadata or managed keywords I need to know the ID for the existing label/keyword. I have this for the Managed Metadata however not for the Managed Keyword.

Currently I create a CSV file to be imported for managed metadata before working out the reverent GUID for the source label.

Many Thanks Luke

A: 

Yes, you can import managed terms (keywords aren't managed) into SP2010. The OOTB Managed Metadata service app can import a CSV file... also has a sample. Importing via the API is very easy as well. The following shows how to get reference to the term store and start adding terms. To add terms, look at the Term object.

// get refrerence to the taxonomy term store
TaxonomySession taxonomySession = new TaxonomySession(siteCollection);
// get reference to first term store (can also get by name)
TermStore termStore = taxonomySession.TermStores[0];
string termGroupName = "Locations";
Group termGroup = termStore.Groups.Where(x => x.Name == termGroupName).Count() > 0 ?
                    termStore.Groups[termGroupName] :
                    termStore.CreateGroup(termGroupName);
string termSetName = "United States Geography";
TermSet termSet = termGroup.TermSets.Where(x => x.Name == termSetName).Count() > 0 ?
                    termGroup.TermSets[termSetName] :
                    termGroup.CreateTermSet(termSetName);
Term newTerm = termSet.CreateTerm("Level 1",1033);
newTerm.CreateTerm("Level 1a",1033);
termStore.CommitAll();

Don't concern yourself with the DB. Read/write ops directly on the DBs are not supported. There's a VERY robust taxonomy API (M.SharePoint.Taxonomy.dll) available.

AC