Support » Installing WordPress » Moving to WordPress from Custom Blog

  • I am curious how hard of an issue it would be to go from my custom coded blog ( to wordpress based blog.

    Reasons for going to wordpress:
    1. Writing WP versions of my scripts would be easier since I would be using it more often
    2. RPC-XML support so I can do things easier like Trackbacks/Pingbacks/Remote Posting/
    3. Larger support for plugins to add more functionality to a blog.

    Reasons why I like my custom blog:
    1. I coded it
    2. Handling of security issues is much easier
    3. People think its cool I coded the entire thing.

    Anyway what I am wondering is, would it be possible to import my data into the WP tables without too much difficulty? The photos/images etc I use are hyperlinks on the full URL.

    Think the only thing that might not go well would be categories and comments.

    I am contemplating just starting from scratch (blog is just over a year old). And then using a 301 redirect to any posts that google cannot find in hoping to save grace with the PR of the blog and any weird issues I might get with having various search entries lead to 404s.

    Not sure if this is in the proper forum, so please move it if needed. Thanks!

Viewing 12 replies - 1 through 12 (of 12 total)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Anyway what I am wondering is, would it be possible to import my data into the WP tables without too much difficulty?

    Direct database transfers using custom code seems like a major pain in the behind. I would recommend using the WXR format instead, as an intermediary. It’s like an extended version of the RSS format.

    Try this. Create a new, blank, WordPress blog. Delete all the default post crap. Add a couple new posts in a couple categories and with various tags, and also some fake comments on them.

    Next, go to the Export menu in WordPress, and export the blog to a file. This will download a file that you can examine. It’s just text, and it will let you see the format of this file. For whatever your custom coded blog is, you should find it somewhat trivial to generate this file, it’s about as straightforward and obvious as it could be (especially if you are at all familiar with XML).

    So, generate a file that looks like that from your blog. WordPress is capable of importing that file directly, in the Import menu.

    I’ll take a look and see. Though it does seem like more work really than I would like to do. But we’ll see.

    Thanks for the reply!

    Ok i created a script where it sets up the posts and comments and categories to the same format that the exported XML file is in.

    I find the following issues when I go to import the file:

    1. Categories are not uploaded, but then I can’t delete the uncategorized or Blogroll categories thinking that this might be the cause.
    2. When I imported 3 posts and comments. The first post was imported and looked ok in Firefox, but the default theme was buggered up too bad in IE.
    3. All the comments were posted properly under the title of the post they were to be under.
    4. After the first post, the body of the 2 other posts I imported, were blank.

    Now my blog has custom styles like <div align="center"><img src="meh.jpg"></div> but I am thinking this is breaking the import on the XML though I am not sure why.

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    It’s really hard to say exactly what the problem is without more specific details.

    Speaking very generally, the post contents do not contain semantic information like “div” and such. It’s supposed to be basic text with some html to put images and such in there. Then you do things like centering and such using CSS and stylesheets, to make the blog fit a uniform theme.

    I thought that might be the issue so i used strip_tags() to remove all the HTML etc from the post and the body of the post doesn’t get uploaded but the title/comments still do.

    I’ve uploaded the script that will output what the XMl looks like:

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Well, your category problem is largely this:

     <![CDATA[ ]]>

    Try making it output something more like this:

    Note that a post must be in at least one category.

    Also, generally WordPress uses <description></description> instead of <description /> but I don’t think that would matter any.

    I don’t see any obvious reason that it would not have grabbed the content:encoded bits though…

    Additional: Your post names won’t work. <wp:post_name> is what we call the “slug”. Must be lowercase, no spaces, no punctuation. something-like-this-will-work as the post name. This is an internal identifier, what would be used in the URL if you used %postname% in the URL. Must be unique as well.

    Ok that makes sense. I added the category in properly and also got rid of the white space I had around the <![CDATA]]> tags (they had line feeds in the script) and now it works nicely and the previous formatting doesn’t break the theme.

    I appreciate your help! I’ll play with it a bit more to make sure it works (i have like 280 rows to import) and then I will see if I can find a theme I like and perhaps I will make the switch to WordPress permanently!

    Oh a quick question: It says that the max file size is 2mb when importing. Is this read by the php.ini file? if so then it can be changed correct?




    yes, and yes. if your host allows it.

    If my host doesn’t allow it can it be done via .htaccess file or withing the scripts? Or would I have to split the file up into small chunks?

    Thought the file is only 1.38MB So i should be good to go!




    If my host doesn’t allow it can it be done via .htaccess file or withing the scripts?

    Uh, if your host doesnt allow it, it cant be done, period.

    IF they do allow it, it depends on what they allow. Some hosts allow you to have a custom php.ini, some hosts allow changes to be made inside your .htaccess.

    Your host can answer those questions.

    Yes @ chunks.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Moving to WordPress from Custom Blog’ is closed to new replies.