Transfers to External Systems
From TechWiki
This document explains how to prepare and then move wiki documents to external content management systems. The example shown is for a transfer to Drupal.
Pre-Transfer Preparation
- Make sure the content you are about to transfer is complete; there are a few steps involved, and repeating them should be avoided if possible
- Add the __NOEDITSECTION__ and __NOTOC__ commands at the top of your source file; this will ensure that extraneous wiki stuff is not included in your transfer (after tranfer, you may want to add these items back in)
- Remove all other extraneous stuff from your source document, such as notification templates, etc., that are relevant to the wiki instance but not your ultimate target
- Try to use CSS classes as much as possible in your source documents, and to have a CSS waiting at the target end that contains the relevant styles named exactly the same.
Transfer Process
- Go to your source document in view mode (not edit mode), and add the string "
?action=renderto the end of the source document URL in your address field- This looks something like,
http://example.com/index.php/Source_Document--> going tohttp://example.com/index.php/Source_Document?action=render
- This looks something like,
- Upon entry, this will create a XHTML rendition of your source document, which will then appear in your browser
- Select all and copy this new document into an HTML editor or view source and do the same with a standard text editor; the next steps will have you make a few corrections to the basis HTML source
- You will want to make at least these changes (experience may indicate others):
- Remove all references to the base URL from the rendered source. This is important for internal anchor links and such. Given our prior example, you would search and replace
http://example.com/index.php/Source_Document?action=renderwith nothing (blank). Be careful to not remove prior internal links such ashttp://example.com/index.php/Source_Document, which may be desirable and were not introduced solely as part of the rendering step - Remove all instances of
class="mw-header". These, and some similar codes, are introduced within the wiki itself and may not be desired in your target
- Remove all references to the base URL from the rendered source. This is important for internal anchor links and such. Given our prior example, you would search and replace
- (If you are using an HTML editor, you may want to generate a new table of contents -- if that is an option for your editor -- at this point)
- Save the revised source HTML code. You may also need to save it with only the
*.htmlextension rather than the*.xhtmlone. (Sometimes browsers do not adequately cut-and-paste theXHTML code, necessary in the steps below) - Now, copy this code. We are now ready to transfer it to the source
- In the source, paste the code (in code or source view, NOT WYSIWYG view if you are using a rich-text editor) into your target
- Make any source code changes required by your target application
- Save the new transferred document.
Final Cleanup
Make any final cleanup. You may notice certain patterns that you could take care of in earlier steps; if so, add them to the workflow above.