For the life of me I cannot figure this one out. I need some help. I need to get my database into wordpress. I found this but really have no idea what to do next: " 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? ----------------------------------------- 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) -------------------------------------------------------- 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) " Anybody know how to do this? I could provide my database for you, etc. if you need it. It would be much appreciated. Thank you.
Best thing to do would be write a small PHP script. Gimme a few minutes to figure the code out. Edit: Here's the code. Modify the DB names and passwords as required. I'm assuming both DBs are on localhost. You might wanna modify the red stuff! Might not be 100% working, haven't tested. Hopefully will work though. Could really be wrong on the date, I didn't get what you tried to say with your date formats. Also the bracket in the weird place. If it says it's in datetime format this should work. lol @ this is my 250th post.
He's trying to import a non-wordpress database, and that php is already up there. Edit: Usage instructions for OP: put that code in notepad, save as port.php, upload to your server, then visit it from your browser.
hi, Its maybe old thread but its very important to me, because i think this code could actually work. Right now im in process of converting and i think it will be converted wrong, because my old category only have this contant: Category and Joke And in code i need: $id=mysql_result($result,$i,"ID"); $title=mysql_result($result,$i,"Title"); $author=mysql_result($result,$i,"Author"); $content=mysql_result($result,$i,"fullText"); $excerpt=mysql_result($result,$i,"previewText"); $date=mysql_result($result,$i,"date"); So how can i set up this? Can i put some querry to add this this automaticaly to my old database and then try to convert to WP? P.S. my WP database is already installed do i detelete it?