Skip to content

PowerShell SharePoint Wiki to Confluence Migration

Follow this PowerShell workflow to read SharePoint wiki pages, adjust internal links, migrate images, and publish Confluence pages without manual rework.

Starting point: Migrating a SharePoint wiki to Confluence

New requirements land on our desks all the time, and one of them recently called for moving an entire SharePoint wiki into Confluence. You could invest in large, expensive migration suites, but in many cases a lean, purpose-built script is the faster and more cost-effective answer.

Why PowerShell is the right tool

A quick search led us straight to AtlassianPS and the ConfluencePS module, which lets you create Confluence wiki pages through code.

PowerShell has helped us solve numerous SharePoint challenges in the past. We used it when we adjusted the Created/Modified attributes after migrating with O365 ShareGate and when we converted Office documents in SharePoint from .doc to .docx.

It offers additional advantages: scripts do not need to be compiled, they stay readable, and they can be adapted within minutes.

Four steps to complete the migration

You can break the entire workflow down into four clear stages.

1. Read the SharePoint wiki page

Start by extracting the complete HTML content from the existing SharePoint page.

Update all hyperlinks so they point to locations that make sense inside Confluence.

3. Copy images from SharePoint to Confluence

Export every referenced asset and upload it to the target space.

4. Create the Confluence wiki page

Finish the migration by provisioning the new page programmatically.

Automating the Confluence provisioning

The final step is essentially a single command:

New-ConfluencePage -Title 'MyNewWikiPage' -SpaceKey 'Wiki' -Body 'PageContents'

To make that command useful, we first prepare the SharePoint wiki content, then hand it over to the ConfluencePS module as the body text.

SharePoint stores the entire page content inside the PublishingPageContent field as HTML. That structure makes it easy to swap hyperlinks and handle embedded images before we create the Confluence page.

  1. Retrieve the SharePoint list item that represents the wiki page.
  2. Read the PublishingPageContent field.
  3. Feed that content into the Confluence provisioning command.
$WikiBody = $PageItem["PublishingPageContent"]

New-ConfluencePage -Title 'SharePoint Wiki Page' -SpaceKey 'TechWiki' -Body $WikiBody | Out-Null

Result: A one-to-one comparison

Screenshot comparing the SharePoint wiki page on the left and the migrated Confluence page on the right

The original SharePoint page is shown on the left, the freshly migrated Confluence page on the right.

This is how straightforward it can be to migrate a SharePoint wiki into Confluence. If you would like support with your own migration scenario, we are happy to help.

Contact us

Related articles

Restore ShareGate Created and Modified Timestamps Fast

Restore ShareGate Created and Modified Timestamps Fast

Learn how to restore Created and Modified timestamps on a local file share after a ShareGate migration by reading the export CSV with a PowerShell script.

Read more
Migrate SharePoint version history intelligently: Less

Migrate SharePoint version history intelligently: Less storage, same traceability

Use hash-based version deduplication to save SharePoint Online storage during a 35 TB migration and avoid Migration API pitfalls.

Read more
Term Store at the limit: Taxonomy migration into a

Term Store at the limit: Taxonomy migration into a shared SharePoint Online tenant

Migrate managed metadata at the SharePoint Online Term Store limit: text, choice, and lookup fields, wire formats, and fallback mapping.

Read more

Questions about this topic?

We are happy to help you put this into practice in your environment.