Offline Updates to the zWiki

From OSF Wiki
Jump to: navigation, search

When using the built-in Special:Export and Special:Import functions on Wikipedia for offline updates to the same site, it is important to note that by convention revisions are not added during re-import unless the timestamp for the imported change is newer than what is already in the database. The explanation for this is provided under the merging histories documentation for Special:Import.

The way to overcome this is to update all the timestamp for all items in the import file. For example, this is what one record might look like in the source XML:

<page>
  <title>Creating Your Own zWiki</title>
  <ns>0</ns>
  <id>677</id>
  <revision>
    <id>16593</id>
    <parentid>16591</parentid>
    <timestamp>2013-11-11T15:22:27Z</timestamp>
    <contributor>
      <username>Mike</username>
      <id>1</id>
    </contributor>
    <text xml:space="preserve" bytes="2105">'''You may freely set up a parallel instance of this zWiki.'''
 
    Additional source document text is provided here . . . .
 
[[Category:Help]][[Category:zWiki]][[Category:About_zWiki]]</text>
    <sha1>bnw262jhht9lj01zzxr27dpncztdkpe</sha1>
    <model>wikitext</model>
    <format>text/x-wiki</format>
  </revision>
</page>

With most programmer text editors it is also possible to do regular expression (regex) search and replaces. In the case of updating the timestamp using Notepad++ as the example, a straightforward regex search string of:

<timestamp>....-..-.....:..:...</timestamp>

can then be replaced with a new one of, say:

<timestamp>2013-11-11T12:00:00Z</timestamp>

When doing so, be careful to pick a new time stamp in the near future so as to not cause internal Mediawiki problems down the road. Also increment in small amounts if it may be necessary to do multiple exports and imports.