[wp-hackers] Blog Import/Export Idea - Google Summer of Code 2010

Mike Schinkel mikeschinkel at newclarity.net
Mon Mar 22 22:06:08 UTC 2010


On Mar 22, 2010, at 5:30 PM, Jue Wang wrote:
> On Mon, Mar 22, 2010 at 5:25 PM, Mike Schinkel
> <mikeschinkel at newclarity.net>wrote:
> 
>> On Mar 22, 2010, at 5:20 PM, Andrew Gray wrote:
>>> 4. Change the URLs in the config table
>> 
>> As I'm working on a domain-switcher plugin for my own use (and possibly to
>> release if there is significant interest in other's testing it) I'm curious
>> for you to elaborate on this step?
> 
> I think he means the 'blog_url' and 'blog_home' entries in the wp_options
> table.

Thanks. 

FYI switching domain goes beyond just 'blog_url' and 'blog_home' entries. For example, the TwentyTen theme in wp3.0 stores URLs for header and background.  Many other themes do the same.  Embedded images in posts contain URLs that need to be updated.  Custom menu items in wp3.0 have a menu_link and if they reference local files they need to be updated.

And many plugins have the same issues where they store local URLs. Then there are the domain-related problems, i.e. any plugin that leverages the Google Maps API needs to have the api key switched when the domain changes.

I've built functionality that I can use when I dump SQL from a local site and then import it to another site.  My plugin handles the cases I've identified in core and then exposes a "switch_domain" hook to allow any plugin to handle their special cases. Of course no plugins will support this but I can build the support for any plugins I might need it for. However I've not yet nailed the best way to "bootstrap" from one domain to another and could really use help with brainstorming the best way to do it robustly.  It would also be great if said functionality made it into core so that plugin authors would start thinking about addressing this concern.
 
If there is sufficient interest in this from others I can share the current code and/or add a ticket to trac.


On Mar 22, 2010, at 5:47 PM, Andrew Gray wrote:
> I could see a system where you install a plugin in on both sites, copy an access key from one to the other, click a button and it moves everything for you.  I just do not think that remotely accessing mysql would be the way to do it.   

Agreed.

> This is probably better suited as a plugin, then in the core however.

The problem is with plugins that persist the local domain in some manner, or with the Google Maps api key. There's a need for plugin authors to have a best practice of including a "switch domain" hook to fixup anything that breaks when the domain is switched (or for others to fix in their negligence) and if its not in the core there won't be enough critical mass for people to do it.

-Mike


More information about the wp-hackers mailing list