{"id":433,"date":"2012-03-29T12:15:41","date_gmt":"2012-03-29T16:15:41","guid":{"rendered":"http:\/\/blogs.law.harvard.edu\/djcp\/?p=433"},"modified":"2012-03-29T12:17:22","modified_gmt":"2012-03-29T16:17:22","slug":"how-to-move-a-wordpress-multisite-to-a-new-folder","status":"publish","type":"post","link":"https:\/\/archive.blogs.harvard.edu\/djcp\/2012\/03\/how-to-move-a-wordpress-multisite-to-a-new-folder\/","title":{"rendered":"How to move a wordpress multisite to a new &#8220;folder&#8221;"},"content":{"rendered":"<p>Moving a wordpress multisite (a SINGLE site, not an entire install) to a new subfolder (not really a folder as it&#8217;s virtual, but whatever) is not hard, but it&#8217;s also not as easy as it should be. Here are the steps I took:<\/p>\n<ol>\n<li>Change the site path from the Network Admin backend, and be sure to have it update &#8220;siteurl&#8221; and &#8220;home&#8221;. Make a note of the siteid while you&#8217;re here, which you can deduce from the &#8220;id=&#8221; parameter in the URL.<\/li>\n<li>Regenerate the permalinks from the &#8220;Settings -&gt; Permalinks&#8221; menu &#8211; I just temporarily switch the permalink structure to something else and right back again to the original settings &#8211; there&#8217;s probably a more elegant way. If you&#8217;re using a custom structure, be sure to note it before you change as it won&#8217;t be retained in the text field.<\/li>\n<li>Fix all the links inside the content &#8211; I just used a mysql &#8220;update&#8221;, like this:<br \/>\n<strong>update wp_&lt;your multisite blog id&gt;_posts set post_content = replace(post_content,&#8217;\/oldpath\/&#8217;,&#8217;\/newpath\/&#8217;);<br \/>\n<\/strong>For bonus points, you can create a backup as a temporary table before the replace. Be aware this backup table will go away after you terminate your mysql connection.<br \/>\n<strong>create temporary table wp_&lt;your multisite blog id&gt;_posts_tmp select * from wp_&lt;your multisite blog id&gt;_posts;<\/strong><br \/>\nThis should fix all embedded media and page links &#8211; but you&#8217;ll still need to test, obviously.<\/li>\n<li>Clear your object \/ apc caches by restarting apache and doing whatever else you need to clear your object cache backend. Since we&#8217;re directly editing mysql tables, the object cache doesn&#8217;t get the clues it needs to decache stale values and you can get weird issues. If you&#8217;ve got a frontend page cache, clear that too.<\/li>\n<\/ol>\n<p>These steps have worked fine here, but it&#8217;s a bit more manual than I had hoped.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Moving a wordpress multisite (a SINGLE site, not an entire install) to a new subfolder (not really a folder as it&#8217;s virtual, but whatever) is not hard, but it&#8217;s also not as easy as it should be. Here are the &hellip; <a href=\"https:\/\/archive.blogs.harvard.edu\/djcp\/2012\/03\/how-to-move-a-wordpress-multisite-to-a-new-folder\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1984,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[17332,17321,3919],"class_list":["post-433","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-multisite","tag-web-development","tag-wordpress"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/archive.blogs.harvard.edu\/djcp\/wp-json\/wp\/v2\/posts\/433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/archive.blogs.harvard.edu\/djcp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/archive.blogs.harvard.edu\/djcp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/djcp\/wp-json\/wp\/v2\/users\/1984"}],"replies":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/djcp\/wp-json\/wp\/v2\/comments?post=433"}],"version-history":[{"count":3,"href":"https:\/\/archive.blogs.harvard.edu\/djcp\/wp-json\/wp\/v2\/posts\/433\/revisions"}],"predecessor-version":[{"id":436,"href":"https:\/\/archive.blogs.harvard.edu\/djcp\/wp-json\/wp\/v2\/posts\/433\/revisions\/436"}],"wp:attachment":[{"href":"https:\/\/archive.blogs.harvard.edu\/djcp\/wp-json\/wp\/v2\/media?parent=433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/djcp\/wp-json\/wp\/v2\/categories?post=433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/djcp\/wp-json\/wp\/v2\/tags?post=433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}