October 13, 2009

Steps for migrating a ASPDotNetStorefront (ASPDNSF) site to a new server

Filed under: Tips — Tags: , , — Webopius @ 11:43 am

We’ve recently helped a client move a live ASPDotNetStorefront (ASPDNSF) site from their existing hosting company to a new server. This included the store, database, email and SSL certificate.

The process is fairly straightforward but it goes without saying that you need to prepare beforehand. We thought that the steps we followed would be of use to anyone else migrating an ASPDotNetStorefront site to a new hosting provider or server.

In our case, we were able to keep the live site fully operational until the last moment at which point we put the site into maintenance mode while we copied across the database and made the DNS changes. As a result, the site was only really down while the DNS changes propagated across the network.

Steps followed to migrate ASPDotNetStorefront (ASPDNSF) to a new server

Understand your site

Before making any changes at all, spend some time looking at the existing site and understanding any customisations that have been made. In our case, the site had custom skins along with a couple of additional directories containing custom code that exported orders in a particular format.

If you do have any customisations like this, review them in detail to make sure they will work on a new server. For example, make sure that the new server doesn’t block specific ports that are used and that the IP address isn’t hard-coded anywhere.

Create a test domain

To make testing as close to the real thing as possible, you should create a testing sub-domain for your site. For example: test.mysite.com. This will allow the bulk of the migration to be tested in a domain similar to www.mysite.com without actually replacing the live ‘www’ subdomain.

Do this by contacting your domain provider and requesting a new DNS A record for the subdomain name you chose that points to your new server’s IP address.

Configure new server’s IIS server

On your new server, ensure IIS is running and create a new website able to render a page under the new sub-domain.
Set the host header values of this site to support BOTH your testing subdomain AND www.

Create a simple static ‘hello world’ web page in this new site and check that when you visit ‘test.mysite.com’ that it renders the page you expected. Don’t proceed until you have this step working.

Backup existing ASPDNSF files

Make a copy of all the LIVE ASPDNSF files (within the live store’s web directory) and move them into the new server within the website directory you created earlier.

Back the existing ASPDNSF database

Create a backup of your live ASPDotNetStorefront database. Create a new database on your new server and restore this database to the new server. Make sure you are able to do this step as quickly as possible as it is the key factor in having minimal downtime when you turn off the current live site.

Make sure that the User security settings match your web.config values on the new server.

Configure the new site

Change the new site’s RedirectLiveToWWW AppConfig value to False.
Put the new site in TEST gateway mode (you don’t want any live transactions!)
What I would also recommend is that you put some text somewhere in your template to show you that this is the new server rather than your existing site.

Test the new site

Now you should have a working set of ASPDNSF website files and a database. At this point you should be able to visit test.mysite.com and see a copy of your live site running. If you see any ASP.Net errors at this stage you need to resolve them before moving forward.

Check permissions

Check that the images directory is writeable for the web server.

Test before going live

Now is your last chance to fully test the site before going live. Make sure everything works as expected.

Export and Import the SSL certificate.

If you are able to, export the existing SSL certificate from the Live site (you should be able to export and keep it live) and then import it into the new server.

If you are not able to export/import, you will need to buy a new SSL certificate (we use Comodo SSL for this).

Go Live on the new server

When you are ready to go live. Make a last backup from the live server’s database and import it into the new server (replacing the existing database).

Now, put your live site in maintenance mode (set the web.config’s SiteDownForMaintenance field to True)

Copy any files modified since you moved the site to the new server across (usually in the images directory)

Web.config

If your database or user settings have changed, edit your site’s web.config and update the database connection string settings to match your new connection.

DNS

Finally, modify your domain’s DNS settings to point to your new server’s IP address.

Within a few hours (or as long as the DNS change takes) you should start to see your site running on the new server.

  • Tags