I am having a hellish time moving over a multisite site. It once had 15 blogs. Now we are moving to a new server. It used to live in a sub-folder called "/blog". Now it is moving to a sub-domain called "blog.domain.com".
I know I have to change the url address in the database, but where? I did find the site url in the options table, and I changed it there, but that is apparently not enough.
I keep getting an infinite redirect loop. Have already tried "sunrise" as a solution, as that is what is recommended elsewhere on the web. That did not work, and, frankly, the "site" variable in Sunrise is blank when I try to echo it to the screen, so something is really broken there.
Each blog has its own suite of tables of course:
Run this query in phpmyadmin under the SQL tab. There are 2 spots you need to update in the wp_options table
UPDATE wp_options SET option_value = replace(option_value, 'http://old.site.url.com', 'http://new.site.url.com') WHERE option_name = 'home' OR option_name = 'siteurl';
then check your .htaccess file and make sure the rewritebase and rewrite rules match the new locations.
Here are the tables you may need to check and change value to your new domain:
wp_options - site_url and home
wp_blogs - domain
wp_site - domain and path
wp_sitemeta - site_url
You also need to update each of the wp_*_options (e.g. wp_1_ , wp_2_, wp_3_) table and adjust the fields site_url and home
UPDATE wp_posts SET guid = REPLACE (guid, 'http://oldsiteurl.com', 'http://newsiteurl.com');
UPDATE wp_posts SET post_content= REPLACE (post_content, 'http://oldsiteurl.com', 'http://newsiteurl.com');
wp-blogs was important. Thanks for that.
You should also change data that is serialized and you cannot change using UPDATE SQL. This tool you provide this functionality: [[LINK href="http://interconnectit.com/124/search-and-replace-for-wordpress-databases/"]]http://interconnectit.com/124/search-and-replace-for-wordpress-databases/[[/LINK]]
It's easy to install and use and it is really functional.
Thanks for that. I would say the serialized data in the database is my least favorite aspect of WordPress.
Edit: Sorry, I was not thinking correctly. The sugestions below are for multisite with different domains, which is my default setup for multisite.
Surely you are using http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/, aren't you?
Also you have changed the configurations from sub folder to sub domains, right?
Doing the sql query that Dan | gteh suggested should fix your issue.
Which configurations to go from sub folder to sub domain?
You must have to change two option into the database
both you can find in 'wp_options' table
0 and 37 respectively
Login to your phpmyadmin
Go to wordpress database
and now click on wp_options table in the left list
now you will see all row in that usually first row you will find with site_url click edit and change to new url
now may be on next page you will find home - (default option_id is 37) click edit and change the url to new url.
Now it should work