The MU forums have moved to WordPress.org

How can i change the domain at a later date? (6 posts)

  1. expat
    Member
    Posted 14 years ago #

    how can change the domain of MU at later date?

  2. andrea_r
    Moderator
    Posted 14 years ago #

    Run a search & replace on the database.

  3. expat
    Member
    Posted 14 years ago #

    really is it that involved? why cant i just change the settings in the admin area?

    i need to change

    mydomain.com/myfolder/

    to

    mydomain.com/mynewfolder/

    or just

    mydomain.com (using virtual host)

  4. andrea_r
    Moderator
    Posted 14 years ago #

    Because it is stored in a great many places.

  5. justinph
    Member
    Posted 14 years ago #

    You have to be careful doing a blanket search & replace. If the new URL changes the file path to uploaded files, it will break much of the metadata associated with uploads in the database. File upload information is stored a serialized array (or object, can't remember), which include a length as part of their serialization. If you change the length of the string, the array won't unserialize correctly and you'll lose the metadata.

    You could work around this by setting up a symbolic link between the new and old folders, or by manually fixing the length parameter of the serialized arrays. The latter is what I have done in some cases, but is generally pretty tricky.

    Or, if you don't need that data, don't worry about it.

  6. andrea_r
    Moderator
    Posted 14 years ago #

    "If the new URL changes the file path to uploaded files, it will break much of the metadata associated with uploads in the database."

    Yep, but you could also change thsoe occurrences as well.

    Bigger SQL statement, but do-able.

About this Topic