Smarter Business Solutions Logo
SMARTER Business Solutions
SharePoint Development

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.

5 Min Read

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

Tags

#Confluence #PowerShell #SharePoint #Wiki

Ready to transform your SharePoint?

Let our experts help you implement the solutions discussed in this article.