Support » Fixing WordPress » Migrating from Non-CMS database site to WP database

  • For the past year I have been running a site with articles that I manually insert into the backend using Phpmyadmin and retreive using mysql and php.

    Now I want to run my site with WP becuase of features such as commenting but can’t figure out how to copy my exsisting articles in the database to WP’s database. There are 100s of them.

    I have searched this forum but most migration related threads are to do with CMS run sites (like jomla and drupal) to WP whereas I was inserting my text by going to the backend.

    Any suggestions?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Take a look at the mysql tables that wordpress uses for storing its posts, comments, users, etc.

    Then take a look at your existing database. All you’ll have to do is write a script to retrieve values from your db and output them to a file as sql statements for the target (wordpress) db.

    It should be pretty straightforward. If you can describe your current database schema, it would help.

    That’s good to hear. I would appreciate it greatly if you give me the basic skeleton and explain how to “output them to a file as sql statements for the target (wordpress) db”.

    Info you might need:
    Database name: sportsArticles

    Table Name: footballtbl
    Fields: ID (int, autoincriment, key), Title (varchar) , Author (varchar), fullText (longtext), previewText (tinytext), date), Qoute (varchar).

    other tables exsist in similar fashion for rugby and athletics.

    Note: Date is in this format (date (yyyy, mm, dd)

    This document explains the wordpress db structure.

    You can use phpMyAdmin to export your existing database into a text file with SQL statements.

    Next, write a parser (regular expression matcher) to go through each sql statement and transform it to the wordpress format.

    Later, import this sql file from phpMyAdmin.

    (Alternately, you could transform the sql statements into xml and import from your wordpress admin interface)

    Is there a tutorial link you can kindly provide me with specially for the 2nd step?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Migrating from Non-CMS database site to WP database’ is closed to new replies.