blog transferred from Bloggerjack

well, that wasn’t too hard! Grep saved my ass and helped me fully form 177 SQL commands to insert my posts into WordPress via phpmyadmin. Thanks Deeje for sending me my data!

Update: I just migrated almost all my postings from my Postnuke site to this one, so.. now I have content all the way from november 2001 to today.

here’s the awesomest grep I’ve ever done:

search with:
\s+<rogue_stories2 >\r.*\r\s+<pn_aid >.*</pn_aid>\r\s+<pn_title >(.*)</pn_title>\r\s+<pn_time >(.*)</pn_time>\r\s+<pn_hometext >(.*)</pn_hometext>\r\s+<pn_topic>(.*)</pn_topic>\r\s+.*\r\s+

replace with:
INSERT into wp_posts set post_author = “2″, post_title = “\1″, post_date = “\2″, post_content = “\3″, post_category = “\4″;\r

and, whabam! 97 fully formed and complete SQL insert calls.

update 2: By taking that last “\4″ from the above grep, you can get a long list of the topic ID’s. By creating another script that does this:

$explodethese = "7,6,5,7,9,8,10,9,5,10,11... (etc)

$j=0;

for($i=188;$i< =(188+95);$i++)
	{
	$exploded = explode(",",$explodethese);

	echo "INSERT into wp_post2cat set post_id = "$i", category_id = "".$exploded[$j]."";";
	$j++;

	}

Now, all my posts from postnuke have their correct topic classifications preserved! Links in the sidenav on the site for “music”, “programming”, etc.. now all work in wordpress. :) Now all I gotta do is migrate a couple more sites.. my t-mobile sidekick blog, and my old wordpress entries, and… I’m up to date all on one page… how cool am I! Ok, I’m a nerd. Whatever, I know I’m cool.

update again: Old wordpress and hiptop blogs are migrated! everything I’ve ever posted on one of my sites is now collected into this one repository!! whewww!!

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter
Bookmark and Share