Edgio

Iterative Migration Tutorial

There are two basic approaches to the iterative migration of a website:
  • Gradual Roll Out: This approach gradually shifts traffic for a specific change or improvement from the legacy site to the new site. This gradual approach balances risk with efficiency by allowing you to verify functionality as you switch a feature or a page to the new site.
  • Gradual Site Buildout: This approach shifts all traffic for a specific change or improvement from the legacy site to the new site. This approach is ideal for small changes, vetted changes, or if you value efficiency over an occassional issue.
This tutorial demonstrates how to gradually roll out new features when migrating a website. This migration involves the following environments:
  • An entry environment through which traffic will be routed.
  • A destination environment to which traffic for the current website will be routed.
  • A destination environment to which traffic for the new website will be routed.
Dedicated Routing Environment

Quick Start

Migrate a website by performing the following steps:
  1. Set up an environment for the current website.
  2. Set up an environment for the new website.
    If you are using Edgio Sites, Cloud Functions, or Edge Functions, then you should set up this environment within a different property’s production environment.
  3. Set up an environment that will split traffic between the above environments.
    1. Remove all rules.
    2. Create an origin configuration for each environment to which traffic will be split.
    3. Create an experiment.
  4. If you are using Edgio Sites, Cloud Functions, or Edge Functions, then you should set the environment defined in step 1 as the production environment.
  5. Test and monitor the experiment.
  6. Adjust traffic splitting.
  7. Conclude the experiment

Assumptions

This tutorial assumes:

Identifying the Entry Environment

This tutorial requires an environment through which traffic for other environments will be routed. We will refer to this environment as the entry environment. We recommend using the environment that contains the hostnames whose traffic will be split.
Reusing an environment that contains your hostnames allows for a seamless transition to traffic splitting and simplifies setup.
If traffic splitting will be performed for a domain that has not been previously registered, then you should perform the following steps:
  1. Create or identify the entry environment.
  2. Register the desired hostname(s) within the entry environment.
  3. Set up TLS for each registered hostname.

Setting Up the Current Website’s Environment

Set up an environment for your current website using either the Edgio Console or the Edgio CLI.
To set up your current website’s environment using the Edgio Console
  1. Create an environment.
    1. Navigate to the Environments page and click + New Environment.
    2. Set the Name option to current-site.
    3. From the Copy settings from environment option, select your production environment.
    4. Click Create.
    Current Site Environment
  2. Deploy your changes.
  3. Verify your website’s functionality using a URL generated by the deployment.
    Latest Deployment
To set up your current website’s environment using the Edgio CLI
  1. Run the following command from your project’s root directory:
    Bash
    1edgio deploy --environment current-site
  2. Verify your website’s functionality using a URL generated by the deployment.

Setting Up the New Website’s Environment

Set up an environment for your new website using either the Edgio Console or the Edgio CLI.
To set up your current website’s environment using the Edgio Console
  1. Create an environment called new-site.
    1. Navigate to the Environments page and then click + New Environment.
    2. Set the Name option to new-site.
    3. From the Copy settings from environment option, select your production environment.
    4. Click Create.
  2. Optional. Adjust your rules to reflect any changes required by your new site.
  3. Optional. Adjust your origin configuration(s) to reflect any changes required by your new site.
  4. Deploy your changes.
  5. Test your new website using a URL generated by the deployment.
To set up your new website’s environment using the Edgio CLI
  1. Create a copy of your project.
  2. Optional. Place your new project under source control.
  3. Optional. From within your routes.[js|ts] file, adjust your rules to reflect any changes required by your new site.
  4. Optional. From within your edgio.config.js file, adjust your origin configuration(s) to reflect any changes required by your new site.
  5. Set up this environment within a different property’s production environment by running the following command from your project’s root directory:
    Bash
    1edgio deploy --property migration-second-variant --environment=new-site
  6. Set new-site as the production environment.
    Learn how to set the production environment.
  7. Verify your website’s functionality using a URL generated by the deployment.

Setting Up the Entry Environment

Set up your entry environment to distribute traffic by performing the following steps:
You may use the following procedure regardless of whether you are using the Edgio CLI to deploy to other environments. However, if you define this environment from within the Edgio Console, you should not deploy to it from the CLI. You may still deploy to other environments using the Edgio CLI.
  1. Identify your production environment.
  2. Create an origin configuration that points to the current-site environment.
    1. Navigate to the current-site environment’s Deployments page.
    2. Load the most recent deployment.
    3. Copy a domain from the URL section.
      Latest Deployment
    4. From the entry environment’s Origins page, create an origin configuration.
      1. Click + Add Origin.
      2. Set the Name option to current-site.
      3. Paste the domain, which was copied in the previous step, within the Override Host Header option.
      4. Paste the domain, which was copied in the previous step, within the Origin Hostname option.
      5. If the domain contains .glb, remove it from both options.
      6. Verify that the Use the following SNI hint and enforce origin SAN/CN checking option was autopopulated with the same domain.
      Your origin configuration should should look similar to the following illustration:
      current-site Origin Configuration
  3. Create an origin configuration called new-site. Point this origin configuration to the new-site environment.
    1. Navigate to the new-site environment’s Deployments page.
    2. Load the most recent deployment.
    3. Copy a domain from the URL section.
    4. From the entry environment’s Origins page, create an origin configuration. Set the
      1. Click + Add Origin.
      2. Set the Name option to new-site.
      3. Paste the domain, which was copied in the previous step, within the Override Host Header option.
      4. Paste the domain, which was copied in the previous step, within the Origin Hostname option.
      5. If the domain contains .glb, remove it from both options.
      6. Verify that the Use the following SNI hint and enforce origin SAN/CN checking option was autopopulated with the same domain.
  4. Create an experiment.
    1. Configure the first variant to:
      • Receive 90% of the site’s traffic.
      • Set the origin to current-site.
        Set Origin Feature
    2. Configure the second variant to:
      • Receive 10% of the site’s traffic.
      • Set the origin to new-site.
        Set Origin Feature
      Your experiment should look similar to the following illustration:
      Experiment
  5. Deploy your changes. Add a label to this deployment to easily identify it in the future.
    Deploy Changes with note

Production Environment

If you are using Edgio Sites, Cloud Functions, or Edge Functions, then you should set the current-site environment as the production environment.
Learn how to set the production environment.

Testing

Test your traffic splitting configuration by requesting your site as you normally would.
The variant assigned to a client persists until cookies are cleared. This means that testing this experiment may require clearing your cookies various times or initiating various distinct private browsing sessions.

Monitoring

Monitor the traffic for both the current and the new site by using two instances of Edge Insights.
  1. Navigate to the current-site environment.
  2. Load Edge Insights by clicking Edge Insights from the left-hand pane.
  3. Under the Top Results section, set the pie charts to metrics that you would like to compare across both sites.
  4. Repeat the above steps for the new-site environment.
  5. Compare data across both environments.
    Synch the time period between both Edge Insights by clicking Now from the left-hand pane of both instances of Edge Insights.

Adjusting Traffic Ratio

Adjust the traffic ratio between the two variants according to your confidence with the new version of your website. Each traffic ratio adjustment requires a new deployment.
Experiment

Concluding the Experiment

Conclude the experiment by shifting 100% of your site’s traffic to the new-site environment.