[wp-hackers] Force a new ABSPATH when moving WordPress?

onlyunusedname onlyunusedname at gmail.com
Thu Mar 22 02:14:23 UTC 2012


Thanks for the kind warning.

I've actually already googled my way through the unserialize/serialze
morass.  I think I have a solution that is working for this particular set
of minimalist sites.  I would never put it forward as a universal solution.

Is there any sort of community-recognized best solution (commercial or non)
for moving a WordPress database in this fashion?  Or is it simply never to
be done (and/or case-by-case when it is absolutely unavoidable)?




On Wed, Mar 21, 2012 at 8:54 PM, Chris Williams <chris at clwill.com> wrote:

> As has been discussed 100,000 times on this list, do not underestimate the
> complexity of #1.  You can't just change a couple of database entries for
> home and base URL.  There are many instances, including all the images and
> other media in attachments.
>
> But the most complicated part is in the serialized data in things like
> user settings.  As someone recently pointed out, if you blindly do a
> search/replace in the serialized data, you mess up the serialized format
> (which includes string length).  The only safe way to do that is to spin
> through all the data, unserialize things, search/replace the URLs, then
> reserialize it and save it back.
>
> In all, it's not for the faint of heart.
>
> On 3/21/12 1:19 PM, "onlyunusedname" <onlyunusedname at gmail.com> wrote:
>
> >Excellent.  Thanks, Otto.  There is eAccelerator running on this server
> >and
> >clearing its cache is just the trick.
> >
> >Just out of curiosity:  If one wanted to write a script that did
> >everything
> >in a more environment agnostic fashion, would that be possible?
> >
> >In other words, this script would run once after a URI change and it
> >would:
> >
> >1) Change the relevant database entries from $old_url to $new_url.
> >
> >2)  [Magically solve a cached ABSPATH problem in a reasonably environment
> >agnostic fashion]
> >
> >3) Redirect to $new_url  (Site successfully moved.)
> >
> >
> >Is step 2 as preposterous as I am making it sound, or can you imagine a
> >feasable-ish answer?
> >
> >Thanks in any event.  You helped me a ton.
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list