{"id":2810,"date":"2018-01-29T10:00:35","date_gmt":"2018-01-29T16:00:35","guid":{"rendered":"https:\/\/www.foell.org\/justin\/?p=2810"},"modified":"2018-01-29T09:42:55","modified_gmt":"2018-01-29T15:42:55","slug":"simultaneous-website-testing-hosting-switch","status":"publish","type":"post","link":"https:\/\/www.foell.org\/justin\/simultaneous-website-testing-hosting-switch\/","title":{"rendered":"Simultaneous website testing before a hosting switch"},"content":{"rendered":"<p>So you&#8217;re getting ready to move your website. You&#8217;ve got the new hosting plan purchased, and you&#8217;ve got the files and data copied over. You set up your hosts file to point to the new host, but something doesn&#8217;t look quite right \ud83d\ude15<\/p>\n<p>You could keep editing your hosts file and refreshing your browser to try to figure out what is different&#8230; Or you could take 5 minutes to set up a socks proxy so you can view both the new and old site in two different browsers at the same time! Here&#8217;s how to do it:<br \/>\n<!--more--><\/p>\n<h2>Prerequisites<\/h2>\n<ol>\n<li>Two browsers, one of which is Firefox.<\/li>\n<li>A server you can connect to via SSH<\/li>\n<\/ol>\n<p>The server can be anything, your new host (if they allow ssh), a friend&#8217;s server, a linode server, a digital ocean droplet, etc.<\/p>\n<h2>Start an SSH tunnel to act as a proxy<\/h2>\n<p>In a terminal on your local system run:<\/p>\n<pre>ssh -D 1080 -N user@your-ssh-host<\/pre>\n<p><code>-D<\/code> instructs ssh to do dynamic port forwarding by creating a socket on that port locally.&nbsp;Any port number will do, but <a href=\"https:\/\/www.w3.org\/Daemon\/User\/Installation\/PrivilegedPorts.html\">something above 1024<\/a> is best. I went with 1080 in this example.<\/p>\n<p><code>-N<\/code> tells ssh to not run any remote commands (like bash). This is needed to have our connection just forward data.<\/p>\n<h2>Configure Firefox<\/h2>\n<p>In Firefox open Preferences. Search for <em>proxy<\/em>. In more recent versions of Firefox, it&#8217;s at the bottom of the general section. Click the proxy <code>Settings...<\/code> button to bring up the proxy connection settings dialog:<\/p>\n<p><a class=\"thumbnail\" href=\"https:\/\/www.foell.org\/justin\/files\/2018\/01\/firefox-proxy.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2811\" data-permalink=\"https:\/\/www.foell.org\/justin\/simultaneous-website-testing-hosting-switch\/firefox-proxy\/\" data-orig-file=\"https:\/\/www.foell.org\/justin\/files\/2018\/01\/firefox-proxy.png\" data-orig-size=\"848,777\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"firefox-proxy\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.foell.org\/justin\/files\/2018\/01\/firefox-proxy-300x275.png\" data-large-file=\"https:\/\/www.foell.org\/justin\/files\/2018\/01\/firefox-proxy.png\" class=\"alignnone size-full wp-image-2811\" src=\"https:\/\/www.foell.org\/justin\/files\/2018\/01\/firefox-proxy.png\" alt=\"\" width=\"848\" height=\"777\" srcset=\"https:\/\/www.foell.org\/justin\/files\/2018\/01\/firefox-proxy.png 848w, https:\/\/www.foell.org\/justin\/files\/2018\/01\/firefox-proxy-300x275.png 300w, https:\/\/www.foell.org\/justin\/files\/2018\/01\/firefox-proxy-768x704.png 768w\" sizes=\"auto, (max-width: 848px) 100vw, 848px\" \/><\/a><\/p>\n<p>Make the changes as indicated. Select <em>Manual proxy configuration<\/em>. Add <code>localhost<\/code> to the <em>SOCKS Host<\/em> field, and <code>1080<\/code> to <em>Port<\/em>&nbsp;and select <em>SOCKS v5<\/em>. Check the box for <em>Proxy DNS when using SOCKS v5<\/em>.<\/p>\n<h2>Browse in Firefox<\/h2>\n<p>Anything you visit in Firefox will now use the DNS information from your proxy. You&#8217;d typically use the Firefox version for the original &#8211; what is soon to be the &#8220;old&#8221; site.<\/p>\n<h2>Set your hosts file for your other browser<\/h2>\n<p><a href=\"https:\/\/support.rackspace.com\/how-to\/modify-your-hosts-file\/\">Edit your hosts file<\/a> and add a line with your new host IP and your domain name:<\/p>\n<p>$ vi \/etc\/hosts<br \/>\n1.2.3.4 thewebsiteiammoving.com www.thewebsiteiammoving.com<\/p>\n<h2>Browse in another browser<\/h2>\n<p>Then you can visit the &#8220;new&#8221; site in that browser to make any comparisons and do last-minute tweaks before you switch your DNS.<\/p>\n<div class='kindleWidget kindleLight' ><img decoding=\"async\" src=\"https:\/\/www.foell.org\/justin\/wp-content\/plugins\/send-to-kindle\/media\/white-15.png\" \/><span>Send to Kindle<\/span><\/div>","protected":false},"excerpt":{"rendered":"<p>So you&#8217;re getting ready to move your website. You&#8217;ve got the new hosting plan purchased, and you&#8217;ve got the files and data copied over. You set up your hosts file to point to the new host, but something doesn&#8217;t look quite right \ud83d\ude15 You could keep editing your hosts file and refreshing your browser to&hellip; <a href=\"https:\/\/www.foell.org\/justin\/simultaneous-website-testing-hosting-switch\/\">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":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"How to simultaneously test the same  website in two places before switching hosts","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1,17,8,22],"tags":[],"class_list":["post-2810","post","type-post","status-publish","format-standard","hentry","category-business","category-dns","category-ubuntu","category-wordpress"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/posts\/2810","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/comments?post=2810"}],"version-history":[{"count":10,"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/posts\/2810\/revisions"}],"predecessor-version":[{"id":2823,"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/posts\/2810\/revisions\/2823"}],"wp:attachment":[{"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/media?parent=2810"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/categories?post=2810"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/tags?post=2810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}