Welcome to our guide about how to migrate your website! This guide is a
three five part series describing some high level techniques that are common to website and server migrations. To begin, we will describe the topics that will be covered along with the required environment setup.
If you are transitioning from an old design to a new design, changing Content Management Systems (CMS) or transferring to a new server, there are several steps that must be carefully executed. For Adroit Technologies, we finished migrating our website to a new design and CMS. We decided to start to a guide to help people who may be confronted with a migration process and to present some issues that people may encounter.
This guide was not designed to be a fully inclusive howto but rather a high level reminder of, "Oh yeah!" to help guide you as to what may be required while you do your transition. So let's begin with what we will cover:
As always, before you do anything, CREATE BACKUPS. Seriously though. If you didn't create backups and something goes wrong, it is always going to be your fault. This is your last warning, create backups please.
Now with that in mind, these are some areas to consider backing up:
Also, don't forget to do the following:
Since your current website is live, we don't want to cause any sort of service interruption that may occur when we upload our new website. We ran into a small issue where we needed to change a configuration path. If we would have over-written our live site with our new site, customers would have noticed the error page.
A simple and easy method to avoid such issues from occurring is to upload the new site into a separate directory and create a simple host file entry. This is a method to test your new website without taking down your old site, while still keeping it semi-hidden from the outside world and while avoiding the setup of new DNS entries to test the site.
To resolve domain names, an operating system uses a few different methods to convert a domain name to its associated IP address. For a basic high level understanding, the process to resolve a domain name is as follows: the operating system first checks its local resolution/cache and then the DNS server that was configured either through DHCP or manually. We are interested in the first option, the local resolution/cache. This is usually implemented through a basic table saved in a file. For Windows XP, this file exists in [Windows Install Directory]\system32\drivers\etc\hosts and for Linux, this will is located in /etc/hosts.
We will edit this file to create a simple "pointer" to our new website without having to modify and update a DNS server. Using this method relies on a virtual host entry in Apache which will be discussed shortly.
Start > Run > cmd ping atws.ca
Now that we have a "domain" that points to our new site, we need to setup an Apache vhost (virtual host) entry.
A virtual host (vhost) allows for a system administrator to serve multiple websites from a single computer on a single IP Address. Typical uses of vhosts are found on shared web hosting. Vhosts rely on the user's browser sending the address that the user typed in to the browser in the Host option of the HTTP header. This allows the server to distinguish which website to serve to the user.
With this brief introduction in mind, let's add some virtual hosts to the vhosts file of Apache
sudo cp ./vhosts ./vhosts.June.17.2010
<VirtualHost 192.168.1.1> ServerName new.yourdomain.com DocumentRoot /path/to/your/new/website/directory DirectoryIndex index.php </VirtualHost>
sudo a2ensite new.yourdomain.com
sudo apache2ctl reload
With the above steps, we have backed up our site and support files, setup a temporary hosts entry and created a vhost entry for Apache. This provides a quick and effective method for site migration with minimal down time. We have also learned about vhosts, domain name resolution and hosts files.
If you have any comments, questions or additions, please comment below!
Look forward later this week for part two of the Site Migration Series where we will discuss traffic and and website monitoring along with system administration techniques to ease this process.