{"id":1527,"date":"2016-05-15T11:03:37","date_gmt":"2016-05-15T11:03:37","guid":{"rendered":"http:\/\/slave24.local\/wordpress\/?p=1527"},"modified":"2016-05-15T11:03:37","modified_gmt":"2016-05-15T11:03:37","slug":"wordpress-troubleshooting","status":"publish","type":"post","link":"https:\/\/andy.teknostatik.co.uk\/kb\/2016\/05\/15\/wordpress-troubleshooting\/","title":{"rendered":"WordPress troubleshooting"},"content":{"rendered":"<p>I&#8217;ve done a fair bit of WordPress troubleshooting over the last few weeks, including moving sites from one server to another and upgrading server operating systems. While a lot of this isn&#8217;t probably that interesting, I did come across a few things that might help other people undertaking similar tasks.<\/p>\n<p>My method for moving content between sites generally involves exporting the content to XML, installing a fresh instance of WordPress on the new server, importing the content using the <a href=\"https:\/\/wordpress.org\/plugins\/wordpress-importer\/\">WordPress Importer<\/a> plugin, and then seeing what doesn&#8217;t work. What <em>usually<\/em> doesn&#8217;t work is uploaded images and files, but it&#8217;s just a case of copying across the whole contents of <code>\/var\/www\/html\/wp-content\/uploads<\/code> to the new server to fix that.<\/p>\n<p>Talking of which, Debian (and derivatives) changed the default location for websites from <code>\/var\/www<\/code> to <code>\/var\/www\/html<\/code> last year. If you upgrade Debian to the latest version and all your WordPress sites break, then it should just be a case of editing <code>\/etc\/apache2\/sites-available\/000-default.conf<\/code> so that the <code>DocumentRoot<\/code> value is set back to to <code>\/var\/www\/<\/code>.<\/p>\n<p>My last revelation is around hardwired links. When moving a site to a new server (with a new URL) there are likely to be many references to the old site URL in config files and in the WordPress database. There is a plugin called <a href=\"https:\/\/wordpress.org\/plugins\/search-and-replace\/\">Search and Replace<\/a> which does all the heavy lifting for you, and which should rewrite your new URL to everywhere it needs to be. I&#8217;ve used this a few times now and it works really well.<\/p>\n<p>I&#8217;m also half way through writing up how I install sites from scratch, but that&#8217;s going to be quite a lengthy document and probably deserves a separate post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve done a fair bit of WordPress troubleshooting over the last few weeks, including moving sites from one server to another and upgrading server operating systems. While a lot of this isn&#8217;t probably that interesting, I did come across a few things that might help other people undertaking similar tasks. My method for moving content &#8230; <a title=\"WordPress troubleshooting\" class=\"read-more\" href=\"https:\/\/andy.teknostatik.co.uk\/kb\/2016\/05\/15\/wordpress-troubleshooting\/\" aria-label=\"Read more about WordPress troubleshooting\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","_share_on_mastodon":"0"},"categories":[3,8,11],"tags":[],"class_list":["post-1527","post","type-post","status-publish","format-standard","hentry","category-debian","category-ubuntu","category-wordpress"],"share_on_mastodon":{"url":"","error":""},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/andy.teknostatik.co.uk\/kb\/wp-json\/wp\/v2\/posts\/1527","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/andy.teknostatik.co.uk\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/andy.teknostatik.co.uk\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/andy.teknostatik.co.uk\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/andy.teknostatik.co.uk\/kb\/wp-json\/wp\/v2\/comments?post=1527"}],"version-history":[{"count":0,"href":"https:\/\/andy.teknostatik.co.uk\/kb\/wp-json\/wp\/v2\/posts\/1527\/revisions"}],"wp:attachment":[{"href":"https:\/\/andy.teknostatik.co.uk\/kb\/wp-json\/wp\/v2\/media?parent=1527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/andy.teknostatik.co.uk\/kb\/wp-json\/wp\/v2\/categories?post=1527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/andy.teknostatik.co.uk\/kb\/wp-json\/wp\/v2\/tags?post=1527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}