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?
Did you move any files with this whole thing? That shouldn't have changed unless you were renaming folders.
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?
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.
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).
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.
If the theme had options in the backend, then those were saved in the db.
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.
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?
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.
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?
crdoughty
Member
Posted 9 months ago #
total replacements performed were 3487
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 :(
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.
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.
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.
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.
jewlzmcq
Member
Posted 9 months ago #
Will do. Thanks @ipstenu and @andrea_r
*scribbling notes* I WILL remember this one day....
tho it;s fair to note that serialization is usually in plugin & widget settings. not the core multisite tables. (that I can remember anyway).
It's in setting for your super admin user, I remember that one.
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
I *knew* it was one of those. :D
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...
or hire someone well versed in multisite to sort it out for ya.
http://wpcandy.com/pros/experienced/with-multisite
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
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!
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.
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.