Hey Guys.. I have a large database which I have bought recently. Its a normal sql database of articles and categories. Now, How can I convert it to use with wordpress?
1st you need to load the database into Mysql, then you must change the table structure to match the one used at WP, in the end all you need is to load data from 1 table into another. If you have more than 1 table (articles, categories, etc...) you need to have 1 table per each matching destiny. BTW, I suggest you do all this locally as it will be much faster (using xampp or whatever).
Hi, i think i understand everything but how to change table structure to match wordpress db? My current website only have 2 tables category and jokes... and wordpress needs many other things like date, title,....
This is not a easy task. You need to write a script that converts other DB to wordpress DB. You need to alter tables and then import table contents. You should have the expertise in writing scripts and SQL.
Yea thats right. i dont ahve expertise in anything but im clsoe to fix this problem. Just i need advice from experts: what i did: I have tweak this script provided by Ulquiorra: http://forums.digitalpoint.com/showpost.php?p=8314776&postcount=2 So script looks like this: <?php //Connecting to the custom database mysql_connect("localhost","root",""); @mysql_select_db("new_jokes") or die( "Unable to select database"); //Querying database for content $query = "SELECT * FROM new_jokes"; $result=mysql_query($query); if (!$result) { print "SQL QUERY [".$sql."] FAILED "; print "[".mysql_error()."]"; } //Exiting this database, connecting to WP database mysql_close(); //Can be commented out if this causes problems mysql_connect("localhost","root",""); @mysql_select_db("laugh") or die( "Unable to select database"); $num=mysql_numrows($result); $i=0; while ($i < $num) { $id=mysql_result($result,$i,"ID"); $title=mysql_result($result,$i,"Category"); $content=mysql_result($result,$i,"Joke"); $uniqueurl = "http://www.laugh.com/?p=".$id; $query = "INSERT INTO wp_posts VALUES ('$id',1, '2009-01-01 00:01:00', '2009-01-01 00:01:00', '$content', '$title', 0, , 'publish', 'open', 'open', , '', , , '2009-01-02 00:00:00', '2009-01-02 00:00:00', , 0, '$uniqueurl', 0, 'post', , 0)"; mysql_query($query); } mysql_close(); ?> Code (markup): Im going to convert it offline. I have install xampp and set up it to use big memory: 1gb is allowed and exectution time is 10 000 seconds, so i just want to ask if this will be enough memory and seconds to convert my jokes database into wp_posts, there are 10 000 jokes, so thats 10 000 posts. Can you guys check if my script is working ok? Maybe i have some error out there? thanks, any tips will be appreciate
Just to let you know I DID IT!!! Its pain in the ass. But now i have 10 000 jokes attached to my wordpress in 1 second, hehe Anyway if you want me to convert your content to posts let me know, im cheap, haha Pay per 1h is 50$ If your database is smaller and not complicated i will sure make it in 1h.
I did something similar with another database but I created a WordPress export file (WRX) that I then imported into my blog. That also allowed me to import data into several different blogs as needed, plus I can convert to other XML-based formats at will. Glad you got the direct sql conversion to work though
To: Dadaas and Decodethis. I'm interested in your methods. Please send the how instructions. I'd like to be able to do it myself. Thanks.