Geopress to Geotag data migration


Just in case you decided to try other location tagging plug-in for your Wordpress today.

I have developed a fairly simple data migration script so that you won’t need to go through the pain of re-adding latitude and longitude for the new plug-in in all your posts.

Essentially, you will need a bit knowledge on how to access your database administration. Typically, you will be using phpmyadmin to manage your Wordpress database.

phpmyadmin

Here is how we do it.

  • Go to your phpmyadmin
  • Select your Wordpress’s database, by default, it has a suffix/prefix of ‘WP’
  • Click on the SQL tab
  • Then, execute the following queries below.

Run this for its latitude…

insert into wp_postmeta (post_id,meta_key,meta_value) (select p.post_id, ‘_geotag_lat’, format(left(g.coord,instr(g.coord,’ ‘)-1), 5) lat from wp_postmeta p join wp_geopress g on p.meta_value = g.geopress_id where p.meta_key = ‘_geopress_id’);

And, run this query to retrieve the longitude…

insert into wp_postmeta (post_id,meta_key,meta_value) (select p.post_id, ‘_geotag_lon’ , format(right(g.coord,length(g.coord) – instr(g.coord,’ ‘)),5) lon from wp_postmeta p join wp_geopress g on p.meta_value = g.geopress_id where p.meta_key = ‘_geopress_id’);

I have migrated mine successfully. Hope it helps for you too!

Popularity: 7% [?]

4 Responses to “Geopress to Geotag data migration”

  1. soo sean  on October 12th, 2009

    OMG! You are an expert! I know where to look for help in future. Kekeke.

    [Reply]

    Hugo Lim Reply:

    hahahhaa.. surely surely… will gimme a note when you need help on these fields :P

    [Reply]

  2. DavidT  on October 22nd, 2009

    wahh… dont really get this… any tutorial on how to setup the hosted wordpress blog?

    [Reply]

    Hugo Lim Reply:

    setting up ahh, tutorials about this is wide spread across the giant webby…. try google around!

    in case you are moving from blogspot to wordpress, then you can see my article on it lah!

    http://www.hugolim.com/2008/09/blogspot-to-self-hosted-wordpress-migration

    thanks for commenting ahh!

    [Reply]


Leave a Reply

Your email is never published nor shared.