WordPress.org

Ready to get started?Download WordPress

Forums

Migrating from Non-CMS database site to WP database (5 posts)

  1. mars16
    Member
    Posted 6 years ago #

    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?

  2. Pravin Paratey
    Member
    Posted 6 years ago #

    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.

  3. mars16
    Member
    Posted 6 years ago #

    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)

  4. Pravin Paratey
    Member
    Posted 6 years ago #

    http://codex.wordpress.org/Database_Description

    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)

  5. mars16
    Member
    Posted 6 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic