How to Migrate MediaWiki Pages and Images to SharePoint
Question details
The user needs a method to migrate exported MediaWiki content, including XML files and image archives, into a SharePoint environment to recreate the wiki structure.

- Product
- Microsoft SharePoint
- Device & OS
- not provided
- Scenario
- Moving an existing wiki knowledge base from MediaWiki to Microsoft SharePoint.
- Observed behavior
- The user possesses raw MediaWiki XML exports and image files but requires a reliable workflow to import and correctly display them as SharePoint pages.
Ensure you have SharePoint Site Administrator permissions and have downloaded the complete MediaWiki XML export along with its accompanying image archives. It is highly recommended to set up a dedicated test SharePoint site to validate the conversion scripts before running a full migration.
Convert XML to HTML and Automate with PnP PowerShell
Since SharePoint cannot directly import MediaWiki XML files, you must first convert the XML data to HTML, then use PnP PowerShell scripts to automate the creation of modern SharePoint pages.
SharePoint Online utilizes modern pages built with web parts, meaning raw MediaWiki XML will not render natively. Transforming the XML into standard HTML prepares the text so it can be inserted into SharePoint's Text web parts programmatically.
Extract and prepare your MediaWiki XML export and image archives in a local, easily accessible directory on your computer.
Convert the XML page content into standard HTML format using an XSLT transformation script or an automated wiki-conversion utility. Keep the resulting HTML files organized.
Navigate to your SharePoint site, open the 'Site contents' menu, and upload your image archives to a designated Document Library (or Site Assets) so they have valid SharePoint destination URLs.
Open PnP PowerShell and connect to your SharePoint environment. Use the 'Add-PnPPage' command inside a loop script to programmatically generate new modern pages based on your file list.
Use PowerShell to inject the converted HTML content into the newly created pages using Text web parts. Ensure your script updates the old image reference links in the HTML to point to the new SharePoint Document Library URLs.

Enhance Your Team Collaboration with WPS Office
While migrating your organizational wiki to SharePoint, you might also need a cost-effective, lightweight productivity suite for everyday tasks. WPS Office provides excellent compatibility with Microsoft file formats, a highly familiar user interface, and robust tools for Word, Excel, and PowerPoint documents—completely free.
- 1. Visit the Website: Go to the official WPS Office website in your browser.
- 2. Download the Installer: Click the 'Free Download' button to get the installation package tailored for your operating system.
- 3. Install and Start Creating: Run the downloaded installer and launch WPS Office to instantly begin managing your collaborative documents.

Frequently Asked Questions
Can SharePoint natively import MediaWiki XML files?
No, SharePoint Online does not feature a built-in tool to directly import or render raw MediaWiki XML exports. The XML content must be converted to HTML before it can be integrated into modern SharePoint pages.
Where should I store my MediaWiki images in SharePoint?
Images should be bulk-uploaded to a designated Document Library or the Site Assets library in your SharePoint site. Once uploaded, you must map and update the image paths in your converted HTML files to reference these new SharePoint locations.
What is PnP PowerShell and why is it needed for this migration?
PnP (Patterns and Practices) PowerShell is a cross-platform command-line module that allows you to automate complex tasks in Microsoft 365. It is essential for this migration because it enables you to bulk-create modern SharePoint pages and populate web parts directly from your locally converted HTML files.
Are there third-party tools available for migrating MediaWiki to SharePoint?
Yes, several third-party enterprise migration tools and professional services are designed specifically for SharePoint content migrations. They often handle the XML-to-HTML conversion, layout mapping, and link resolution automatically, which can save substantial time for large, complex wikis.




