# How do Knowledge migration tools assist organizations in transitioning legacy documentation into Lightning Knowledge?

**Topic:** Service Cloud · **Difficulty:** Medium · **Tags:** Service Cloud, Knowledge Migration, Content Import

Read it on the site: https://www.forcechallenges.com/interview-questions/how-do-knowledge-migration-tools-assist-organizations-in-transitioning-legacy-documentation-into-lightning

## Answer

**Basics:** Lightning Knowledge stores articles in one object (commonly `Knowledge__kav`) and uses record types for what Classic Knowledge handled with separate article types. Teams migrate from Classic Knowledge or import from external sources (SharePoint, wikis, spreadsheets).

**How it works:**
- From Classic Knowledge: use the Knowledge Migration Tool in Setup (Migrate to Lightning Knowledge) to map each article type to a record type and fields to the unified object. Do this first in a sandbox; the process is effectively one way.
- From external sources: prepare data (title, URL name, summary, body, language, record type), then load into Knowledge__kav as Draft with Data Loader or Bulk API.
- Assign Data Categories through the DataCategorySelection child object.
- Publish drafts via `KbManagement.PublishingService.publishArticle` or the UI.
- Test search, channel visibility and page layouts.

**Advanced / deep dive:** Key IDs: the article version Id (`Id`) versus the master KnowledgeArticleId. Each article needs a unique UrlName. Rich text bodies with images need images uploaded and referenced correctly; plain HTML from old systems should be cleaned. Preserve metadata with custom fields and external ID fields to enable re-runs and traceability. Translations are separate versions per language. Knowledge user license (UserPermissionsKnowledgeUser) is required for authors. Plan for taxonomy cleanup: migration is a chance to retire stale articles. Check limits on article fields and rich text size in current documentation.

**Code / config example:**
```apex
// Publish migrated draft articles (check DML and publish limits for large volumes)
for (Knowledge__kav v : [SELECT KnowledgeArticleId FROM Knowledge__kav
                         WHERE PublishStatus = 'Draft' AND Language = 'en_US' LIMIT 100]) {
    KbManagement.PublishingService.publishArticle(v.KnowledgeArticleId, true);
}
```

**Hidden gotchas & must-remember points:**
- Test the migration in a sandbox; reversing is difficult.
- Article types and fields need explicit mapping to record types and fields.
- Inserted articles are drafts until published.
- Data categories are separate records and are easy to forget.
- Duplicate UrlName values cause load errors.
- Publishing in loops consumes governor limits; use batch for big sets.

**Best practice:** Clean and map content before loading, load in a sandbox first, and keep an external ID for traceability.

---
Source: ForceChallenges · last updated 2026-11-02
