This is a command line tool to convert the contents of a Confluence space into a MediaWiki import data format.
xml
extension must be installedpandoc
>= 3.1.6. The pandoc
tool must be installed and available in the PATH
(https://pandoc.org/installing.html).migrate-confluence.phar
from https://github.com/hallowelt/migrate-confluence/releases/tag/latestchmod +x migrate-confluence.phar
migrate-confluence.phar
to /usr/local/bin/migrate-confluence
(or somewhere else in the PATH
)Step 1:
Step 2:
Step 3:
/tmp/confluence/input/Confluence-export.zip
)/tmp/confluence/input/Confluence-export
)
entities.xml
and exportDescriptor.properties
, as well as the folder attachments
/tmp/confluence/workspace/
)/tmp/confluence/
), run the migration commands
migrate-confluence analyze --src input/ --dest workspace/
to create "working files". After the script has run you can check those files and maybe apply changes if required (e.g. when applying structural changes).migrate-confluence extract --src input/ --dest workspace/
to extract all contents, like wikipage contents, attachments and images into the workspacemigrate-confluence convert --src workspace/ --dest workspace/
(yes, --src workspace/
) to convert the wikipage contents from Confluence Storage XML to MediaWiki WikiTextmigrate-confluence compose --src workspace/ --dest workspace/
(yes, --src workspace/
) to create importable dataIf you re-run the scripts you will need to clean up the "workspace" directory!
/tmp/confluence/workspace/result/
to your target wiki server (e.g. /tmp/result
)workspace/space-id-to-prefix-map.php
for reference.workspace/attachment-file-extensions.php
for reference.php maintenance/importImages.php /tmp/result/images/
to first import all attachment files and imagesphp maintenance/importDump.php /tmp/result/output.xml
to import the actual pagesYou may need to update your MediaWiki search index afterwards.
It is possible to use a yaml file to configure the commands analyze, extract and convert. As an expample see /doc/config.sample.yaml
.
The configuration file can be applied by adding the option --config /tmp/config.yaml
.
Not all parameters of config.sample.yaml
have to be used in the config file. If something is not part of it the default will be used.
There is now a compatibility for the mediawiki extension https://www.mediawiki.org/wiki/Extension:NSFileRepo
which restricts access files and images to a given set of user groups associated with protected namespaces.
If NSFileRepo is used the upload of the images can not be done with the script maintenance/importImages.php
but with extensions/NSFileRepo/maintenance/importFiles.php
.
Example: php extensions/NSFileRepo/maintenance/importFiles.php /tmp/result/images/
In confluence user spaces are protected. In MediaWiki this is not possible for namespace User
. Therefore user spaces are migrated to a namespace User<username>
which can be protected in BlueSpice for MediaWiki
.
AttachmentsSectionEnd
AttachmentsSectionStart
Excerpt
Info
InlineComment
Layout
Layouts.css
Note
Panel
RecentlyUpdated
SubpageList
SubpageListRow
Tip
Warning
PageTree
SpaceDetails
ViewFile
Be aware that those pages may be overwritten by the import if they already exist in the target wiki.
Icon-info.svg
Icon-note.svg
Icon-tip.svg
Icon-warning.svg
Be aware that those files may be overwritten by the import if they already exist in the target wiki.
The output generated by the tool contains certain elements that need additonal extensions to be enabled.
In the case that the tool can not migrate content or functionality it will create a category, so you can manually fix issues after the import
Broken_link
Broken_user_link
Broken_page_link
Broken_image
Broken_layout
Broken_macro/<macro-name>
composer update --no-dev
box compile
to actually create the PHAR file in dist/
. See also https://github.com/humbug/box<br />
) to one<b>
) from headings<img />
)<code>
lines into <pre>
=== '''Some heading''' ===
)<ul><li>==== Lorem ipsum ====</li><li>'''<span class="confluence-link"> </span>[[Media:Some_file.pdf]]'''</li></ul><ul>
)<span class="confluence-link"> </span>
, <span class="no-children icon">
)