Last night I realized there was one more step needed to restore my 2002-2006 archive. All of my references into that archive from this blog, which started in December 2006, had to be redirected. What’s more, they had to be remapped. Old URLs like http://weblog.infoworld.com/udell/2006/12/04.html#a1571 had to become new URLs like http://jonudell.net/udell/2006-12-04-hunting-the-elusive-search-strategy.html.
Even without the remapping, it’s not obvious how to do a simple search and replace (say, from weblog.infoworld.com/udell to jonudell.net/udell) across a set of blog entries. I tried the export/edit/import route, but — at least in the case of WordPress — that doesn’t seem to be a way to update existing stuff.
So I wound up writing a script that uses the MetaWeblog API to fetch my current blog entries, find references to the old namespace, adjust them to point to the new namespace, and update the entries. It’s here for my own future reference, and for yours if you need it.
As always in these situations, I end up wondering what a civilian would do. Blog publishing systems don’t seem have bulk search-and-replace capability. They do, however, have APIs. There could be a tool or service that helps people make these kinds of changes. It’d be hard to avoid the password anti-pattern, so if this were a cloud-based service rather than a locally-installed tool you’d want to change your password after using it. But still, it should be doable.
Do such tools or services exist?
June 10, 2009 at 11:42 am
I know of a plugin for WordPress to do this. I used it once when I converted my blog into WordPress. http://urbangiraffe.com/plugins/search-regex
June 10, 2009 at 11:55 am
I recently went through a similar process, moving from Movable Type to WordPress AND changing namespaces at the same time.
It was slightly tricky, but the combination of HTTP 301 redirects and the Search and Replace [http://wordpress.org/extend/plugins/search-and-replace/] plugin did the job for me.
June 10, 2009 at 1:14 pm
mrblogdotorg:
> I know of a plugin for WordPress to do
> this.
jason:
> the Search and Replace
> [http://wordpress.org/extend/plugins
> /search-and-replace/] plugin did the job
> for me.
Thanks for those pointers.
FWIW, on this iteration of my blog I decided not to use a DIY wordpress.com setup, although I’m clearly capable of doing so, but rather to use the standard kit provided at wordpress.com.
One reason was so that I could have the same experience as people who can’t or don’t want to DIY.
From that perspective, I’m now thinking about all the folks in that category who will never want to monkey with plugins, but who do need services that plugins typically provide, and that /could/ be provided by external tools or services through APIs.
June 11, 2009 at 3:01 pm
What’s the functional difference between installing a WP plugin that does some task, and setting up and running a separate script that uses the WP API to do that task? There is an access/security issue, and there are usability pros and cons to each I guess… but it seems more like a tradeoff than a sure win/lose.
June 12, 2009 at 12:26 pm
“What’s the functional difference between installing a WP plugin that does some task, and setting up and running a separate script that uses the WP API to do that task?”
None really if you do it in the geeky way I did.
But I’m imagining a service that would do the latter thing as an agent for the user.
That service would thus provide a feature — in a way that would be independent of any blog publishing platform — that users could access and pay for a la carte.
June 14, 2009 at 12:34 am
Your blog is a great place in the internet. Very interesting. I always come in for see news and interested contents. Mentalidade
July 12, 2009 at 2:06 am
I am looking to replace mass content simultaneously from a data bank at regular time sequences to refresh content…is this possible?
September 24, 2009 at 6:33 am
Great post try checking out some of the wordpress plugins.
January 30, 2010 at 4:47 am
I’ve written a plugin at WordPress.org which enables you (with a GUI) to find and replace in your posts,pages and/or trashed items: http://wordpress.org/extend/plugins/find-replace/