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.

Please consider registering
guest

Log In

Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Headspace2 migration
July 8, 2010
1:31 pm
wavesoftech
New Member
Forum Posts: 1
Member Since:
July 8, 2010
Offline

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

November 1, 2010
5:35 pm
hainish
New Member
Forum Posts: 1
Member Since:
November 1, 2010
Offline

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);
?>

Forum Timezone: America/New_York

Most Users Ever Online: 205

Currently Online:
30 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

romiojuliat: 102

yaoming987: 50

jintuy: 50

miki1986: 33

newshow: 28

karen1234: 27

Member Stats:

Guest Posters: 0

Members: 6356

Moderators: 3

Admins: 4

Forum Stats:

Groups: 5

Forums: 23

Topics: 1546

Posts: 3450

Newest Members: carofern@cisco.com, pronto, jessie, pbaylies, ninaeast, freda

Moderators: davecashmore (2), aaron (5), tempadmin (0)

Administrators: WordPress Professional (442), hallsofmontezuma (202), onefinejay (10), stevemortiboy (4)