Headspace2 migration Installation / Upgrading - All in One SEO Pack Forum

The support forums have a new home! Please visit All in One SEO Pack's new residence at Semper Plugins to purchase a support plan.

 
You must be logged in to post
Search Forums:


 






Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

Headspace2 migration

Post
New Member

wavesoftech

posts 1

1:31 pm July 8, 2010

I'd like to move to all in one but is there a script available to migrate the data contained in headspace2 to all in one?

Thanks

New Member

hainish

posts 1

5:35 pm November 1, 2010

I couldn't find one, so I created one. This should work for the latest versions of headspace2 and All-in-one-SEO. I had to migrate because headspace2 wasn't working properly in wordpress 3.0.1

<?php
$mysql_link = mysql_connect('localhost','db_user','db_password');
mysql_select_db('db_name');

$migration_array = Array(
'title' => Array(
'_headspace_page_title',
'_aioseop_title'
),
'description' => Array(
'_headspace_description',
'_aioseop_description'
),
'keywords' => Array(
'_headspace_metakey',
'_aioseop_keywords'
),
);

print_r($migration_array);
foreach($migration_array AS $seo_element){
$from_query = mysql_query("SELECT post_id, meta_value FROM wp_postmeta WHERE meta_key='".$seo_element[0]."'");
if(mysql_num_rows($from_query) > 0){
while(list($post_id, $meta_value) = mysql_fetch_row($from_query)){
mysql_query("DELETE FROM wp_postmeta WHERE post_id=".$post_id." AND meta_key='".$seo_element[1]."'");
mysql_query("INSERT INTO wp_postmeta (post_id, meta_key, meta_value) VALUES (".$post_id.",'".$seo_element[1]."','".str_replace("'","\\'",$meta_value)."')");
}
}
}

mysql_close($mysql_link);
?>


About the WordPress Developer Forum

Forum Timezone: America/New_York

Most Users Ever Online: 205

Currently Online:
25 Guests

Currently Browsing this Topic:
1 Guest

Forum Stats:

Groups: 5
Forums: 23
Topics: 1543
Posts: 3447

Membership:

There are 6357 Members

There are 4 Admins
There are 3 Moderators