Exporting one.com blog 5

I had the need to export a one.com blog a while ago, to move the posts to a new WordPress blog. The one.com blogs are a totally proprietary system that doesn’t have an export feature. I found one tool that seemed promising. Unfortunately it had a few quirks:

  • The export format was not undocumented, and couldn’t be imported into WordPress.
  • Not all pictures were exported

When researching different export formats I found that the exported file looked a lot like a TypePad export. I added the needed separators and changed a few tags to match the TypePad format (which is a format that WordPress can import).

The picture export issue was traced to a badly formulated RegEx. I corrected the expression so that it matches all <img> tags.

Thanks to Foks for the original code!

And here is the scipt. Just unzip it, upload it to your one.com server (in a subdirectory named export), and point you browser to http://yourblog.com/export. The rest should be self-explanatory. Get your exported files from the server via FTP.

Before importing to WordPress I had to do a search-and-replace operation on the image URLs so they pointed to their new location on the new webserver.

5 thoughts on “Exporting one.com blog

  1. Reply Kalle jul 18,2011 23:14

    Great, thanks a lot for this!

    I had to write my own script to download images from some kind of image gallary that some of the posts I moved contained, but other then that your script worked great.

    Thanks again!

  2. Reply Heine jan 31,2012 11:53

    Hi

    I get an error ”Could not write file”.
    I have tried making the folder ”export” writeable, but I still get a error.

    Can you help?

  3. Reply Fredrik feb 4,2012 23:45

    Sorry for not answering quicker. I’m not sure why the script can’t write files if you did 'chmod 777 export' on the folder. Of course the One.com blog engine may have changed since I used this, or some security setting might have changed. I don’t remember having any permissions trouble.

    Are you running the script on the one.com server? Though I never tried it maybe you’ll have better luck running the script on another host, or your own computer using xampp or the like.

  4. Reply Sniko feb 14,2012 22:53

    I got the same issue as above, with write errors, after looking at it a bit I found an error in the script, where images are included in the post but placed in a folder directly on the server (It seems this is the case for posts with emoticons etc.)…

    I fixed the issue by changing:


    if(count($out_pictures[1])>0)
    {
    foreach($out_pictures[1] as $picture_url)
    {
    $filename_array = explode("=",$picture_url);
    $output .= "PICTURE: ".$filename_array[1]."\n";
    write_file($filename_array[1],get_url("http://iloapp.".$domain_name."/blog/".$picture_url));
    }
    }

    to


    if(count($out_pictures[1])>0)
    {
    foreach($out_pictures[1] as $picture_url)
    {
    $filename_array = explode("=",$picture_url);

    if(!isset($filename_array[1])) {
    $filename_array_alt = explode("/",$picture_url);
    $filename_array[1] = end($filename_array_alt);
    }
    $output .= "PICTURE: ".$filename_array[1]."\n";
    write_file($filename_array[1],get_url("http://iloapp.".$domain_name."/blog/".$picture_url));
    }
    }

    Hope it might help anyone else looking for a solution.

Lämna ett svar