Migrating from Existing MySQL Setup to WordPress

I currently have a database with the following schema:

Table: Articles Columns: ID, Title, Author, Content

Read More

Table: Authors Columns: ID, AuthorName, EmailAddress

Table: Categories Columns: ID, CategoryName

I’m interested in moving this over to WordPress. I do NOT actually need to preserve the authors or categories tables because we are revamping those sections in the migration. However I DO need to save certain rows (or all, if easier) of the articles table. This includes keeping the author ID linked to it. I’m willing to do manual queries in order to select which rows I want to move over to the new table, but I’m not sure exactly where I should do this. So my question is: How can I move these articles over to WordPress in the easiest, most seamless fashion?

Bonus points if I’m able to assign authors on import somehow.

Related posts

1 comment

  1. If you’re fairly well-versed in WordPress plugin development, you could write a couple plugins, one to create your users with wp_create_user(), and another to insert your articles as Posts using wp_insert_post() (which, among other things, allows you to specify the post_author on each post that you insert).

    If you’re not so comfortable writing plugins, then there are a couple of tools that might make your life easier. One is Import Users from CSV — I’ve never used this plugin, but it sounds like something that might work for you. Once you’ve got your users created, WordPress has some import tools built in to the backend at Tools > Import. If you can craft an RSS feed for your existing articles — or if you’ve already got one — you can import your articles using the RSS importer.

    If that doesn’t work out for you, there are a host of “importer” plugins to try. My only recommendation is to backup your database before you try any of them.

    Edited to Add — there’s a Codex page on importing content — it may answer some questions for you.

Comments are closed.