Transfers to External Systems

From OSF Wiki
Jump to: navigation, search

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

  1. 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
  2. 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)
  3. 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
  4. 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

  1. Go to your source document in view mode (not edit mode), and add the string "?action=render to the end of the source document URL in your address field
    • This looks something like, http://example.com/index.php/Source_Document --> going to http://example.com/index.php/Source_Document?action=render
  2. Upon entry, this will create a XHTML rendition of your source document, which will then appear in your browser
  3. 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
  4. You will want to make at least these changes (experience may indicate others):
    1. 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=render with nothing (blank). Be careful to not remove prior internal links such as http://example.com/index.php/Source_Document, which may be desirable and were not introduced solely as part of the rendering step
    2. 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
  5. (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)
  6. Save the revised source HTML code. You may also need to save it with only the *.html extension rather than the *.xhtml one. (Sometimes browsers do not adequately cut-and-paste theXHTML code, necessary in the steps below)
  7. Now, copy this code. We are now ready to transfer it to the source
  8. 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
  9. Make any source code changes required by your target application
  10. 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.