I was running wordpress 2.0.5 since 2 years and did not get time to upgrade to WordPress 2.3.
So I decided last week to upgrade to WordPress 2.3 and I did. I upgrade the same way how wordpress advice us here.
After installation, I did notice it has migrated my categories tables to wordpress 2.3 Terms tables but nothing migrated from Tags tables. I was surprised! Did I make any mistake? Then it comes into my mind, it is Ultimate Tag Warrior plugin, which has created those tables for me not WordPress.
Now I had to migrate those tags from Tags table to Terms tables. So I wrote a script that does that job for me. I thought let me make that available to you, if someone would like to extend the script and build a smart plugin!
I would like you to read this before you use this script:
- Take backup of your database. It is not going to delete anything in the database though.
- Make sure you have Tags tables from Ultimate Tag Warrior in your database.
- Since Unique index created on slug column in Terms table, this script will add ’2′ add the end of tag if any duplicate key/slug found in the Terms table.
- Set MySQL Connection parameters in this file.
- Upload it to your server and run it. Just run it once!
- Do no forget to share your feedback via comments!
If you would like to look at it and review/install, please download PHP Code here.
Thank you for your script. It saved me a lot of time. The only thing is, that it has problems with german umlaut. But that is only a little problem since now I don’t have to convert the tags myself.
Excellent! Thanks.
I had to update the script to work with 2.6 — the table structure had changed for wp_term_relationships. So the insert need another value:
INSERT INTO
wp_term_relationships
VALUES
(“.$objectFetchRow["post_id"].”, “.$termsTaxonomy_id.”, 0)”
I also tried to recode the script to avoid the duplicate terms (pointing them back to existing terms), but this script didn’t work, and i didn’t have the patience to debug it…
it looks like a nice site, thanks..
LOL
that doesn’t even make any sense!
Thank you for the nice post. I liked also your theme colours.
What tamplate do you use in your blog? Very interesting articles
Excellent article, bookmarked for future referrence
Considerably, the article is in reality the freshest on this worthwhile topic. I agree with your conclusions and will thirstily look forward to your forthcoming updates. Saying thanks will not just be sufficient, for the fantastic clarity in your writing. I will at once grab your rss feed to stay privy of any updates. Pleasant work and much success in yourbusiness enterprize!
Thanks for your comment. I was using different (free) themes available on internet and then end up using my own site‘s design.