Testing a Migration: Editing Your Host File

Posted on How-To

When conducting a site migration, it can be really helpful to see if the move worked properly & the site is functioning before pointing nameservers & making the change live. In a lot of cases, data will transfer “successfully” but then actually require a few extra tweaks before the site is online. Simply put: you need to test the migration before you make it live.

So, to tell our individual computer to look somewhere else before loading a website, we’ll have to edit the host file on our computer.

One

Log into Terminal.

Two

Type the following, and then press enter.

sudo nano /etc/hosts

Three.

Type in your computer password, then press enter.

Four.

You should now see a window that looks something like this:

Now you’ll want to locate the new server IP (i.e. where you migrated the content to) and add it to the next line on this window. Then tab forward and type the domain you’re working with.

So for the purposes of this guide, let’s say that I was migrating labrumfield.com to Reclaim’s Dinojr server. The IP for Dinojr is 104.243.45.66. So, my terminal would look like this:

^Make sure to include two lines– one with www., and one without!

Five

Press Control + X.
Press Y to save.
Press Enter.

Six.

Clear your browser cache, and then reload the site! You should now be able to identify any errors on the site before it goes live.

Leave a Comment

Your email address will not be published. Required fields are marked *