Forums

[resolved] Changing URL domain name on wordpress multisite (30 posts)

  1. crdoughty
    Member
    Posted 9 months ago #

    I am trying to change the URL for my site. This is on a virtual ubuntu server, so to make things easier, I cloned the machine before making any changes and am able to revert back to the old machine very quickly. I started by editing the vhost entries in the default file in sites-available for apache, changed the entries in the hosts file to the new url, and edited the wp-config.php file as per instructions. I then exported the database and changed all occurrances of the old site to the new and re-imported it. The site comes back up, but the custom themes are all gone and exporting them from the working site and re-importing them does not fix them. What am I missing, or where have I gone wrong?

  2. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 9 months ago #

    Did you move any files with this whole thing? That shouldn't have changed unless you were renaming folders.

  3. Andrea_r
    team pirate
    Posted 9 months ago #

    but the custom themes are all gone

    no idea what you mean by this. gone, as in no longer physically present in wp-content/themes/? or gone as in no styles on the sub blogs?

  4. crdoughty
    Member
    Posted 9 months ago #

    I cloned the whole server, so files are exactly the same as on the old box. When I say gone, the theme is still applied to the individual sites, but the customizations are all gone. So like in the css where there once was code, there is none and so forth. Again, all files are still there, but when viewing the site, it has the default theme and settings.

  5. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 9 months ago #

    the theme is still applied to the individual sites, but the customizations are all gone

    Where did you make these changes? via a plugin or ... what?

    That might be a DB copy issue (that is, I believe safeCSS stores your CSS changes in the DB, so if that didn't get brought up correctly, it could do that).

  6. crdoughty
    Member
    Posted 9 months ago #

    The theme on the main site is a custom community pro child theme created by one of the people doing the developement of this site. It has several options including Header, Menu, Sidebars, Buddypress, CSS, etc. The customized theme options are what are missing once I change all occurrences of the old domain name in the database. We tried exporting the theme from the old site and importing it to the new site, but not all settings imported correctly and we wound up with double menus and missing other elements.

  7. Andrea_r
    team pirate
    Posted 9 months ago #

    If the theme had options in the backend, then those were saved in the db.

  8. jewlzmcq
    Member
    Posted 9 months ago #

    Actually the theme settings that we were able to export were working or still looking for items under the old url, not the new one. But the widget settings were not part of the theme setting file. The widget settings disappeared and the main menu made a duplicate and had 2 of all menu items on the new url site.

  9. crdoughty
    Member
    Posted 9 months ago #

    Any idea why they wouldn't automatically apply with the new domain name in place after doing a replace on all occurences of the old domain name. Or any idea where to start looking in the database for possible problems?

  10. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 9 months ago #

    I would guess, based on jewlzmcq's comment, that when you brought 'em over, the domain name didn't change.

    I then exported the database and changed all occurrances of the old site to the new and re-imported it

    Did you look for olddomain.com or http://olddomain.com or http://www.olddomain.com ? It's possible you missed some.

  11. crdoughty
    Member
    Posted 9 months ago #

    Old site: fayettevilleforward.org
    New site: fayettevillecommunitylink.org

    used the following command to export db:
    mysqldump --add-drop-table -h localhost -u wordpress -p wordpress > wordpress.sql

    Used notepad to
    replace: fayettevilleforward
    with: fayettevillecommunitylink

    and the following to import:
    mysql -u wordpress -p wordpress < wordpress.sql

    Does anything jump out at you from that process?

  12. crdoughty
    Member
    Posted 9 months ago #

    total replacements performed were 3487

  13. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 9 months ago #

    Only something @wpmuguru mentioned in passing about why he always uses domain.loc and domain.com so that the number of letters are the same and ... damn it, that's as far as my brain is going right now :(

  14. Andrea_r
    team pirate
    Posted 9 months ago #

    serialization in things like widgets ;) they also store how many characters long the name is. if your replacement is off... then that serialization is off too.

  15. jewlzmcq
    Member
    Posted 9 months ago #

    Forgive me if this is a stupid question but....

    they also store how many characters long the name is. if your replacement is off... then that serialization is off too

    does this mean the new domain name should be the same nunmber of characters as the old or that we need to make other changes to get the new domain to take?
    Thanks.

  16. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 9 months ago #

    Serialization! Thank you, Andrea! (Tell wpmuguru I owe him a coffee!).

    jewlzmcq - Yes. Kind of. One or other has to be true, and I've not a clue what the 'other changes' are.

  17. Andrea_r
    team pirate
    Posted 9 months ago #

    It means you need to make other changes. Look in the db in those areas for brackets like { and things like s:13.

    s means serialize and 13 means the name following has 13 characters.

  18. jewlzmcq
    Member
    Posted 9 months ago #

    Will do. Thanks @ipstenu and @andrea_r

  19. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 9 months ago #

    *scribbling notes* I WILL remember this one day....

  20. Andrea_r
    team pirate
    Posted 9 months ago #

    tho it;s fair to note that serialization is usually in plugin & widget settings. not the core multisite tables. (that I can remember anyway).

  21. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 9 months ago #

    It's in setting for your super admin user, I remember that one.

  22. Curtiss Grymala
    Member
    Posted 9 months ago #

    Just as a point of clarification, Andrea, the "s" in the serialized item stands for "string" rather than "serialized". :)

    In the case of the domain name, it will always be "s", because domain names are all string; but you could also see "a" (array), "i" (int), and even "b" (boolean).

    If you need to serialize or unserialize things on the fly (for instance, copying the serialized string out of your database dump, unserializing it, making the change you want to make, and then serializing it again to put it back in your database dump), you can use these two handy tools:
    http://www.functions-online.com/serialize.html
    http://www.functions-online.com/unserialize.html

  23. Andrea_r
    team pirate
    Posted 9 months ago #

    I *knew* it was one of those. :D

  24. crdoughty
    Member
    Posted 9 months ago #

    The {s:##:\"http://sub/sitename/and/path is all over the database with varying sizes. I am not a programmer and only have basic sql skills, so I am going to confer with our local programmer here and see if she can figure out how to fix this. Otherwise, it may be cheaper and easier to buy another domain name...

  25. Andrea_r
    team pirate
    Posted 9 months ago #

    or hire someone well versed in multisite to sort it out for ya.

    http://wpcandy.com/pros/experienced/with-multisite

  26. crdoughty
    Member
    Posted 9 months ago #

    Yeah, looks like it will be much cheaper to get another domain name with the same number of characters. Lol

  27. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 9 months ago #

    Or ... redo it all.

  28. crdoughty
    Member
    Posted 9 months ago #

    Went to accesscommunitylink.org which is the same length as the original and all worked like a charm! Thanks for all your help!

  29. xsn0w
    Member
    Posted 9 months ago #

    I was just about to undertake something like this. I can't believe the length of the domain name is important to existing serialized plugin data.

  30. Andrea_r
    team pirate
    Posted 9 months ago #

    It am be dne but you need to know what you're doing. there are search and replace tools that take care of the serialisation as well.

Reply

You must log in to post.

About this Topic