{"id":1034,"date":"2017-05-10T10:10:56","date_gmt":"2017-05-10T09:10:56","guid":{"rendered":"http:\/\/www.haxed.me.uk\/?p=1034"},"modified":"2017-05-10T10:10:56","modified_gmt":"2017-05-10T09:10:56","slug":"moving-wordpress-site-much-ado-nothing","status":"publish","type":"post","link":"https:\/\/haxed.me.uk\/index.php\/2017\/05\/10\/moving-wordpress-site-much-ado-nothing\/","title":{"rendered":"Moving a WordPress site &#8211; much ado about nothing !"},"content":{"rendered":"<p>Have you noticed, there is all kinds of advise on the internet about the best way to move WordPress websites? There is literally a myriad of ways to achieve this. One of the methods I read on<br \/>\nwp.com was:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nChanging Your Domain Name and URLs\r\n\r\nMoving a website and changing your domain name or URLs (i.e. from http:\/\/example.com\/site to http:\/\/example.com, or http:\/\/example.com to http:\/\/example.net) requires the following steps - in sequence.\r\n\r\n    Download your existing site files.\r\n    Export your database - go in to MySQL and export the database.\r\n    Move the backed up files and database into a new folder - somewhere safe - this is your site backup.\r\n    Log in to the site you want to move and go to Settings &gt; General, then change the URLs. (ie from http:\/\/example.com\/ to http:\/\/example.net ) - save the settings and expect to see a 404 page.\r\n    Download your site files again.\r\n    Export the database again.\r\n    Edit wp-config.php with the new server's MySQL database name, user and password.\r\n    Upload the files.\r\n    Import the database on the new server.\r\n<\/pre>\n<p>I mean this is truly horrifying steps to take, and I don&#8217;t see the point at all. This is how I achieved it for one my customers. <\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n1. Take customer Database Dump\r\n2. Edit the database searching for 'siteurl' with vi\r\nvi mysqldump.sql\r\n:?siteurl\r\n\r\nAnd just swap out the values, confirming after editing the file;\r\n\r\n&#x5B;root@box]# cat somemysqldump.sql  | grep siteurl -A 2\r\n(1, 'siteurl', 'https:\/\/www.newsiteurl.com', 'yes'),\r\n(2, 'home', 'https:\/\/www.newsiteurl.com', 'yes'),\r\n(3, 'blogname', 'My website name', 'yes'),\r\n\r\n<\/pre>\n<p>Job done, no stress https:\/\/codex.wordpress.org\/Moving_WordPress. <\/p>\n<p>There might be additional bits but this is certainly enough for them to access the wp-admin panel. If you have problems add this line to the wp-config.php file;<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ndefine('RELOCATE',true);\r\n<\/pre>\n<p>Just before the line which says <\/p>\n<p>\/* That&#8217;s all, stop editing! Happy blogging. *\/<\/p>\n<p>And then just do the import\/restore as normal;<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmysql -u newmysqluser -p newdatabase_to_import_to &lt; old_database.sql\r\n<\/pre>\n<p>Simples! I really have no idea why it is made to be so complicated on other hosting sites or platforms.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Have you noticed, there is all kinds of advise on the internet about the best way to move WordPress websites? There is literally a myriad of ways to achieve this. One of the methods I read on wp.com was: Changing &hellip; <a href=\"https:\/\/haxed.me.uk\/index.php\/2017\/05\/10\/moving-wordpress-site-much-ado-nothing\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33,70,37,2,61],"tags":[100,99],"class_list":["post-1034","post","type-post","status-publish","format-standard","hentry","category-apache","category-development","category-disaster-recovery","category-mysql","category-rackspace","tag-rackspace","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/1034","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=1034"}],"version-history":[{"count":1,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/1034\/revisions"}],"predecessor-version":[{"id":1035,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/1034\/revisions\/1035"}],"wp:attachment":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=1034"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=1034"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=1034"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}