1 of 1 found this page helpful

mindtouch.import

    mindtouch.import.exe is a command line tool for exporting, importing and copying pages from a MindTouch-powered site.  The import/export operations use the API over HTTP(s) and can be performed from any machine with access to the site.

    A copy of mindtouch.import.exe is included with your MindTouch installation in the same folder as mindtouch.host.exe.  If you do not have access to it, you may also download the most recent version from here.

    Table of Contents

    Requirements

    MindTouch 9.08 or later

    .NET 3.5/Mono 2.4 or later

    Modes

    The tool can perform one of three actions: export, import, or copy.

    Note: If the genconfig option is specified, the provided arguments are used to generate an xml configuration file that can be used to excecute the specified command using the config option. Regardless of whether the documents to export is specified by the exportpath option, an external exportlist or exportdoc, the generated configuration file will have embedded the loaded or created export document inside the config file.

    Export

    Example: Export entire site starting at the root as zip archive, mywiki.zip. This will prompt for user and password.

    mindtouch.import -e -h mywiki.com -r mywiki.zip

    Defining What to Export

    mindtouch.import uses the MindTouch import/export facilites, requiring an export manifest to define what subset of the site to export. In order to simplify this process mindtouch.import provides several ways to define the export manifest.

    Single Hierarchy

    To export a single page the exportpath option should be used. In order to export a hierarchy, i.e. a page with all it's children and dependents the recursive flag needs to be defined as well.

    Note: Copy and Export presents a special case in which exportpath can be omitted, forcing it to default to the same values as exportreltopath, i.e. '-X /foo' means "export /foo, relative to /foo". Omitting exportreltopath as well uses the default value of /, i.e. exporting the root of the site, and with recursive defined, the entire site.

    List of Pages/Hierarchies

    If more than a single page or hierachy needs to be exported, exportlist needs to be used instead. exportlist expects a path to a text file containing a list of URIs or paths (must start with a / ). Each path/URI defines a page or page hierarchy depending on whether the recursive flag is  defined. The list can contain comments (lines starting with # ) and blank lines.

    Example list:

    # here's a path
    /foo/baz
    
    # here's a URIs
    http://mywiki.com/foo/bar
    
    # index.php style Uri's are also valid
    http://mywiki.com/index.php?title=foo/%26_some_strange_name
    
    Custom Export

    Finally, if the previous two methods are too limiting, the export manifest can be specified manually per the specification.

    Import

    Example: Import a zip archive of a wiki under /backup. This will prompt for user and password.

    mindtouch.import -h mywiki.com -I /backup mywiki.zip

    Note: In the case of import the [target] can also be a URI to the package, i.e. the following is also legal usage of import

    mindtouch.import -h mywiki.com -I /backup http://mindtouch.com/packages/mypackage.zip

    Copy

    Copy can only be used to copy content within a single MindTouch instance. In order to copy content from one instance to another, a separate export and import must be used.

    Note: Copy and Export presents a special case in which exportpath can be omitted, forcing it to default to the same values as exportreltopath, i.e. '-X /foo' means "export /foo, relative to /foo".

    Example: Recursively copy a subtree within a site from /staging to /production. This will prompt for user and password.

    mindtouch.import -c -h mywiki.com -X /staging -I /production -r

    Using a configuration file

    All options can be specified either on the command line or in an xml configuration file. Both methods can be used together, i.e. the configuration file could contain the authentication information, so that it isn't part of the command line, while the remaining options are specified on the command line.

    The format of the configuration file uses attributes for each commandline option. Any option-attributed omitted is treated just like an omitted command line option. In addition the exportdoc option can be omitted and the export document inlined directly:

    <config export='(true|false)'
            copy='(true|false)'
            config='{path}'
            host='{host}'
            uri='{uri}'
            archive='(true|false)'
            importreltopath='{path}'
            importrelto='{id}'
            exportreltopath='{path}'
            exportrelto='{id}'
            exportdoc='{path}'
            exportpath='{path}'
            recursive='(true|false)'
            authtoken='{token}'
            user='{username}'
            password='{password}' >
      
      <!-- the archive/directory target. For export or copy operations only -->
      <target>{path}</target>
      
      <!--optionally inlined export document-->
      <export>
        ...
      </export>
    </config>

    Complete list of command line options

    Running the tool without any command line options prints the usage instructions.

    USAGE: mindtouch.import.exe [options] [target]
    
      [target] is either a path to a directory or a filepath ending in .mtarc or .mtapp
         (not used for copy operations)
    
    Options:
        (Options must be prefixed by a '-' or '/')
    
        Modes: Import (default), Export or Copy
          e|export                 - export mode
          c|copy                   - copy mode
    
        General:
          ?|usage                  - display this message
          C|config <path>          - confguration xml file (see below)
          g|genconfig <path>       - instead of executing the command, generate the config file for later execution
          h|host <host>            - MindTouch host (assumes standard API location)
          u|uri <api-uri>          - specify the full uri to the API
          a|archive                - force the target to be treated as an archive file
          f|folder                 - force the target to be treated as a folder
          I|importreltopath <path> - relative uri path for import and copy destination
          importrelto <id>         - relative page id for import and copy destination (alternative to importreltopath)
          X|exportreltopath <path> - relative uri path for export and copy source
          exportrelto <id>         - relative page id for export and copy source (alternative to exportreltopath)
          D|exportdoc  <filename>  - filename of the export xml document for export or copy
          L|exportlist <filename>  - list of paths or uri's to pages to export (respects 'recursive' flag)
          p|exportpath <path>      - specifies the uri path to export (in lieu of specifying an export document/list)
          r|recursive              - export all child documents of 'exportpath' or 'exportlist'
          o|output                 - output file/directory path for import or export
          R|retries                - Maximum number of retries on import/export item failures (default: 3)
          l|preservelocal          - mark package to preserve local changes to existing pages on import
          O|overwritelocal         - mark package to preserve local changes to existing pages on import
                                     (overwrite is the default unless the package has a different value set, in which case
                                      this flag can be used to forces overwrite behavior on import)
          s|securityrestriction (public|semipublic|private)
                                   - enforce a page restriction for all imported content
          cap <capability-name>[=<capability-value>]
                                   - add a capability requirement for the exported package. The default for capability-value
                                     'enabled'
    
        Authentication:
          (if no authentication is provided, the program will prompt for user and password interactively)
          A|authtoken <token>      - authtoken to use for user authentication
          U|user <username>        - username for authentication (requires password option
          P|password <password>    - password for username authentcation
    
    Xml Configuration:
        Commandline options can be provided by or augmented with an xml configuration document:
          <config [option-longname]='value' ...>
            [ <target>{output/input file/dir for import/export}</target> ]
            [ <export><!--optionally inlined export document--></export> ]
          </config>
        Value-less options are booleans and have an xml attribute value of 'true' or 'false'.
        The 'genconfig' option creates this configuration document from the provided settings for later use.
    Was this page helpful?
    Tag page
    Viewing 14 of 14 comments: view all
    My debian-vmware-image cant locate mindtouch.import, does anyone knows where it is located?
    Posted 00:37, 19 Oct 2009
    @henryContreras it's located in the same folder as mindtoch.host.exe; note that mindtouch.import only ships in 9.08 and later edited 05:57, 19 Oct 2009
    Posted 05:57, 19 Oct 2009
    @SteveB: That is true. But how would I use the mintouch.import.exe on a linux-machine? .exe is a Windows-Executable. ;-)
    Posted 01:20, 3 May 2010
    @tbender just like the mindtouch app itself, mindtouch.import runs on linux using mono. other than the mindtouch desktop suite, all our apps run on windows and various flavors of linux
    Posted 05:17, 3 May 2010
    @tbender to run a .NET .exe on linux you just prefix the command with 'mono', i.e. mono mindtouch.import.exe [args]
    Posted 06:39, 3 May 2010
    Thanks guys. That was the point I was missing. Unfortunately now I keep getting an "Unable To Authenticate". Is there a way to trace the API-Calls that the wiki received? Some kind of log in the wiki? A debug-Parameter for the mindtouch.import.exe ?
    Posted 05:07, 4 May 2010
    Do the API-Calls required for this script need to be configured/activated first?
    I just tried to do an export of a wiki that i can otherwise access via browser. Using mindtouch.import to export the content I get prompted for username and password, which I leave blank (since it is not required) the result is an exception:
    MindTouch Import, Copyright (c) 2009 MindTouch Inc.
    User:
    Password:
    ERROR: System.Exception: Unable to authenticate
    bei MindTouch.Deki.Tools.Import.Program.Authenticate(Opts opts)
    bei MindTouch.Deki.Tools.Import.Program.Main(String[] args)
    Posted 08:05, 5 May 2010
    Import/export cannot be done as anonymous, so some user/password credentials are required
    Posted 08:53, 5 May 2010
    export / import seems not to export/import access restrictions :-(
    Posted 08:14, 4 Jun 2010
    no, export/import is purely content. It's not currently meant as a strict backup but more content migration, which means that users and permissions on the destination are not known. It's something we may add later.
    Posted 08:37, 4 Jun 2010
    note: mindtouch.import doesn't grab Templates or User pages by default. To get them use "-p", e.g. `mindtouch.import.exe -e -h mywiki.com -p /Template: -r mywiki-templates.zip` edited 00:04, 20 Sep 2010
    Posted 23:58, 19 Sep 2010
    Hi! on my wiki I have a double authentication. One on web server and other on wiki. How Can I bypass this problem ?
    If I run the import script I receive:
    ERROR: System.Exception: Unable to authenticate
    in MindTouch.Deki.Tools.Import.ImportProgram.Authenticate(Opts opts)
    in MindTouch.Deki.Tools.Import.ImportProgram.Main(String[] args)
    Posted 01:37, 29 Sep 2010
    @pico i suggest you file a bug report. see instructions here: http://developer.mindtouch.com/en/kb/Filing_a_bug_report
    Posted 13:38, 29 Sep 2010
    Hey guys/gals... I just spent 4 hours trying to get my backup off a hosted jumpbox and finally moved the file over to my new setup.

    I get this error: ERROR: System.Exception: Import failed: xdoc is empty ---> System.InvalidOperationException: xdoc is empty
    at MindTouch.Xml.XDoc.Attr (System.String tag, System.String value) [0x00000]
    at MindTouch.Xml.XDoc.Attr (System.String tag, Boolean value) [0x00000]
    at MindTouch.Deki.Tools.Import.ImportProgram.FixupManifest (MindTouch.Xml.XDoc manifest, MindTouch.Deki.Tools.Import.Opts opts) [0x00000]
    at MindTouch.Deki.Tools.Import.ImportProgram.Import (MindTouch.Deki.Tools.Import.Opts opts) [0x00000]
    --- End of inner exception stack trace ---
    at MindTouch.Deki.Tools.Import.ImportProgram.Import (MindTouch.Deki.Tools.Import.Opts opts) [0x00000]
    at MindTouch.Deki.Tools.Import.ImportProgram.Main (System.String[] args) [0x00000]


    after I:

    # mono mindtouch.import.exe -h mywiki.com -I / mywiki.zip

    I am able to authenticate correctly prior to the error. edited 21:34, 1 Nov 2010
    Posted 21:29, 1 Nov 2010
    Viewing 14 of 14 comments: view all
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by