This server will be upgraded at 3pm Sydney time on December 3rd (December 2nd, 8pm PST) and will be down for up to 30 minutes.

OpenWiki Importer

This application is written in C# using the .Net 2.0 framework. It imports most OpenWiki content and requires some experience with using a compiler.

Setup

  1. If you do not have a C# compiler installed, download the .NET Framework Version 2.0 Software Development Kit and install it now. The C# compiler filename is csc.exe
  2. Download http://confluence.atlassian.com/plugins/servlet/proxy-counter/openwiki.converter/1/http://confluence.atlassian.com/download/attachments/144813/OpenWikiExport.csproj.zip
  3. Review the comments section of this page. Some user may have contributed source-code modifications that you would like to incorporate.
  4. Open app.config and find the <OpenWikiExport.Properties.Settings> section
  5. Find the <value> tag, which should be http://nycapp1:8080/rpc/soap/confluenceservice-v1 by default and modify this to point to your Confluence SOAP API. The API is the Confluence base URL plus:
    /rpc/soap-axis/confluenceservice-v1?wsdl
    

    You can find your base URL under Administration -> General Configuration. An example usage for a base URL of http://localhost:8080 is:

    http://localhost:8080/wiki/rpc/soap-axis/confluenceservice-v1?wsdl
    
  6. Save app.config
  7. Compile the Console Application using the C# compiler

Usage

To run the importer, use:

OpenWikiExport [OpenWiki Site Url] [Confluence Space] [Confluence UserName] [Confluence Password]

where:

  • [OpenWiki Site Url] is the address for your OpenWiki instance
  • [Confluence Space] is a valid Confluence spacekey that is not already in use. The space must not already exist
  • [Confluence UserName] and [Confluence Password] is the login for a Confluence user who is a member of confluence-administrator

An example usage would be:

OpenWikiExport http://localhost:8080/OPENWiki DOC confadmin secret

Labels

contentconverter contentconverter Delete
wikiconverter wikiconverter Delete
wikiimporter wikiimporter Delete
plugin plugin Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Nov 22, 2005

    Jonathan Nolen says:

    Very cool, Kevin. Thanks for contributing this!

    Very cool, Kevin. Thanks for contributing this!

  2. Mar 28, 2006

    Thomas Crowder says:

    Hi, I've tried to compile this program, but it is looking for Web References\Co...

    Hi,

    I've tried to compile this program, but it is looking for Web References\ConfluenceSOAPAPI\Reference.cs . I haven't been able to find this file anywhere. Any ideas?

  3. Mar 30, 2006

    Kevin Dotzenrod says:

    you'll need to add a web reference to the confluence soap api

    you'll need to add a web reference to the confluence soap api

    1. Apr 26, 2007

      Tim Annan says:

      How do you do this? Any chance you can supply a compiled version with a XML con...

      How do you do this?

      Any chance you can supply a compiled version with a XML config file to set the path?

      Thanks

  4. Aug 10, 2006

    Dave Buchholz says:

    What version of confluence did this work with? I am using 2.2.7. I had to upda...

    What version of confluence did this work with? I am using 2.2.7.

    I had to update it to access OW on our network to use authentication credentials. XMLDocument.Load does not use the current default ones so I was getting a 401 error. I modified it to use HTTPWebRequest and streams which work fine.

    Now my problem is in storing the page. I get the following error: "You're not allowed to view that space, or it does not exist."

    I have double checked my confluence permissions, used a new account and my admin account. Since it's a test install, I have opened up all the permissions for individual, group and global. The exception happens in LoadPage() at the following point:

    ConfluenceSOAPAPI.RemotePage NewPage = ConServ.storePage(Token, Pg);

    There is a valid Pg at that point with content, etc. Any tips?

  5. Oct 24, 2006

    Lauri Siljamäki says:

    Hello all, I have now tried this importer successfully with our Openwiki instan...

    Hello all,

    I have now tried this importer successfully with our Openwiki instance. I just had an issue with non-qualifying URI with the attachment links. I changed it (in LoadAttachments function) to work by adding the OWSite before the attachment link, like this:

    
    // Add the OWSite to make a fully qualifying URI out of the attachment link
    HttpWebRequest HRequest = (HttpWebRequest)WebRequest.Create(string.Format(@"{0}/{1}", OWSite, ndTable.ChildNodes[i].ChildNodes[1].ChildNodes[0].Attributes["href"].Value));
    // Changed from the below line
    //HttpWebRequest HRequest = (HttpWebRequest)WebRequest.Create(ndTable.ChildNodes[i].ChildNodes[1].ChildNodes[0].Attributes["href"].Value);
    

    I also added two new replaces to the TranslateOpenWikiPage function to

    • fix the JIRA:DUAL-1234 shortcuts to Confluence format of DUAL-1234@jira.
    • to change <TableOfContents> Openwiki macro to Confluence {TOC} macro
    // Fix Jira links
    sConPageData = Regex.Replace(sConPageData, "JIRA:([A-Z]*-[0-9]*)", Regex.Unescape("\\[$1@jira\\]"));
    
    // Use TOC macro
    sConPageData = sConPageData.Replace("<TableOfContents>", "{TOC}");
    

    With these changes this importer seems to work very nicely.

    br,

    Lauri

  6. Jan 22, 2007

    Dave Buchholz says:

    For the record, I did sort out my issue with OW. Our site is using authenticatio...

    For the record, I did sort out my issue with OW. Our site is using authentication for each page. So I hacked up my own OW connect function instead of the GetOpenWikiPage function. It could be modified to to read these values from the command line, but this worked for our conversion and that's all I needed.

            public static string RequestPage(Uri resource)
            {
                //'---User's credential---
                string username = "username";
                string password = "password";
    
                // Create a new HttpWebRequest object for the specified resource.
                WebRequest request=(WebRequest) WebRequest.Create(resource);
    
                // Supply client credentials.
                ICredentials cred = new NetworkCredential(username, password);
                request.Credentials = cred;
                HttpWebResponse response = (HttpWebResponse) request.GetResponse();
                // Determine whether mutual authentication was used.
                Console.WriteLine("Is mutually authenticated? {0}", response.IsMutuallyAuthenticated);
                // Read and display the response.
                Stream streamResponse = response.GetResponseStream();
                StreamReader streamRead = new StreamReader(streamResponse);
                string responseString = streamRead.ReadToEnd();
               Console.WriteLine(responseString);
                // Close the stream objects.
                streamResponse.Close();
                streamRead.Close();
                // Release the HttpWebResponse.
                response.Close();
                return responseString;
            }
    
  7. Jan 22, 2007

    Biju Chacko says:

    I get the same error: "You're not allowed to view that space, or it does not exi...

    I get the same error: "You're not allowed to view that space, or it does not exist." How did you resolve this?

    1. Apr 22, 2007

      Brendan Patterson says:

      This means the user / login with which the application is logging in has not bee...

      This means the user / login with which the application is logging in has not been granted write access to that space. To fix this go to that space's 'browse space' > space admin > permissions and give that user write access to the space. The UWC now has a test for this.

      1. Jul 03

        clint kyksa says:

        I am still having this issue after checking the UWC test for this. I have no ide...

        I am still having this issue after checking the UWC test for this. I have no idea what to do.

  8. Apr 25, 2007

    ajay says:

    I tried this solution using this openwikiconverter and some of the pages mi...

    I tried this solution using this openwikiconverter and some of the pages migrated to Confluence successfully. It some of the pages failed.

    I found that pages that are failed are defined in the indentation. For example:

    Test Page1 and Page2

    • Page 3
    • Page 4

    It has successfully migrated Page1 and Page2 links to Confluence but failed to migrate Page3 and Page4. It looks like some issue with hyperlinks defined in the indentation. I am using the following statement to retreive pages in the openwikiexporter program (Program.cs)XmlNodeList lstOWPages = XMLOWIndex.SelectNodes("xhtml:html/xhtml:body/xhtml:a", nsmOWIndex);It looke like I have to add something else to add above mentioned pages to migrate all the pages successfully.

    Can someone comment on this please.

    Thanks

  9. Apr 27, 2007

    ajay says:

    In additon to my previous problem, I noticed that after migration (open wiki to ...

    In additon to my previous problem, I noticed that after migration (open wiki to confluence) its not showing any hyperlinks which are internal to Wiki. It only only hyperlinks which are external to Wiki.

     In above example, it only shows hyperlinks if they are external.

     Any suggestions?

  10. Oct 05, 2007

    Jeff Howell says:

    The attachement seems to be corrupt. Can someone please upload the attachment th...

    The attachement seems to be corrupt. Can someone please upload the attachment that works?

    1. Nov 21, 2007

      Paul Papathomas says:

      I had the same problem but Jonathan Nolen kindly sent me over the zip file direc...

      I had the same problem but Jonathan Nolen kindly sent me over the zip file directly. I have since been told that it's an IE issue.

      The code worked pretty much as is, with a few tweaks needed to the XPath for some reason:

      XmlNodeList lstOWPages = XMLOWIndex.SelectNodes("xhtml:html/xhtml:body/xhtml:table/xhtml:tr/xhtml:td/xhtml:a", nsmOWIndex);

      Did 400 pages in 15 minutes or so.

  11. Jan 03, 2008

    Anthony Wakeman says:

    Has anyone got this to work with any of the more recent Confluence Releases? I h...

    Has anyone got this to work with any of the more recent Confluence Releases? I have 2.7 and even after applying the patch for conf-10235, Confluence Soap API is broken, I'm still getting a series of errors telling me

    The type or namespace name 'confluenceservice' does not exist in the namespace 'OpenWikiExport.ConfluenceSOAPAPI'(are you missing an assembly reference?)

    Any help or information will be much appreciated.

    - Anthony Wakeman 

  12. Jul 03

    clint kyksa says:

    Anthony, I believe you are trying to open the .cs file directly. Try opening the...

    Anthony, I believe you are trying to open the .cs file directly. Try opening the project which is supplied in the unzipped files. 'OpenWikiExport.csproj'

    Now. On to my error. I am also getting some files which are missing when I try to build this in Visual Studio 2008. I open the project and then click build but when I do this it throws these 3 errors:
    "Error    1    Source file '...\OpenWikiExport.csproj\Web References\ConfluenceSOAPAPI\Reference.cs' could not be opened ('Unspecified error ')    OpenWikiExport"
    "Error    2    Source file '...\OpenWikiExport.csproj\Properties\AssemblyInfo.cs' could not be opened ('Unspecified error ')    OpenWikiExport"
    "Error    3    Source file '...\OpenWikiExport.csproj\Properties\Settings.Designer.cs' could not be opened ('Unspecified error ')    OpenWikiExport"
    These files are missing. I don't have alot of experience with Microsoft projects and how to debug why this file is not being downloaded or created but I would really appreciate any help. Thanks.

    Confluence Version: Version: 2.5.8 Build:#814 Oct 02, 2007
    Open Wiki Version: 0.91

    1. Jul 03

      Anthony Wakeman says:

      Chris, I also ran into these errors. I made some notes at the time about the fix...

      Chris, I also ran into these errors. I made some notes at the time about the fixes, but I haven't had the time to go back and verify that I captured all the steps.

      •  In Visual Studio's Solution Explorer, find ConfluenceSOAPAPI under WebReferences, Right click and select Update Web Reference. this should correct your error #1.
      • Editing OpenWikiExport.csproj to remove the following lines seems to fix the other errors<Compile Include="Properties\AssemblyInfo.cs" />
        <Compile Include="Properties\Settings.Designer.cs">
        <AutoGen>True</AutoGen>
        <DesignTimeSharedInput>True</DesignTimeSharedInput>
        <DependentUpon>Settings.settings</DependentUpon>
        </Compile>

      hope that helps.

      1. Jul 03

        clint kyksa says:

        Anthony thank you so much for your help. I have got it to compile and am now stu...

        Anthony thank you so much for your help. I have got it to compile and am now stuck on one more error.

        "" # *Migrate Page FrontPage*
        ## Retrieved Source Page
        ## Completed Regex Conversion of Page Data
        ## Failed to load page with error _You're not allowed to view that space, or it does not exist._ ""

        I am not an administrator but I can create a new space when I log in. I was wondering if there was a way to just add to an existing space instead of it having to be a new space. Thanks.

        1. Jul 03

          Anthony Wakeman says:

          Clint, Glad I could help. Definitely create the space ahead of time. The direc...

          Clint,

          Glad I could help.

          Definitely create the space ahead of time. The directions indicating that the space can not exist are wrong.

          1. Jul 03

            clint kyksa says:

            I am still having this issue but might have overlooked a lead. I initially chang...

            I am still having this issue but might have overlooked a lead. I initially change the app.config file to point to my confluence server ip but when I open the .csproj file the web reference points to 192.168.242.17 instead of my confluence server I told it to use. I don't know if this is happening in the binaries as well or if this matters at all. Once I change the ip though it builds correctly.

            I also have 21 warnings when building the project. I could post them somewhere if that might help anybody. (aka. Anthony)

            I was also wondering about the contents of 'OpenWikiExport.csproj.user', there is a line which has:

            <StartArguments>http://azimuth.office.mktw.net/MWISWiki owtest OpenWikiImport asdf</StartArguments>

            I don't know if this is of any use/interest but I don't really know what it means.
            As you can see I am frustrated and under pressure so any help/leads would be appreciated.