ARCHIVED: Migrate your customized IU Web Framework site to Sitehost

This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.

On this page:


Overview

Follow the steps outlined below to migrate your customized IU Web Framework site from Webserve to the Sitehost service.

Note:
The process of migrating an IU Web Framework website requires technical knowledge and familiarity with IU's WCMS, so be sure to work with your unit's web development or IT staff. If your unit does not have web development or IT expertise, email Tier 2 WSS.

If your IU Web Framework website hasn't been customized, see ARCHIVED: Migrate your IU Web Framework site to Sitehost instead.

If your site doesn't use the IU Web Framework, follow the ARCHIVED: Sitehost migration guide instead.

1. Create a new Sitehost account

Note:
You must be the owner or proxy of a Group account to request Sitehost for it.

Verify that Two-Step Login (Duo) is enabled for the Group account for which you want to request Sitehost; see Use Two-Step Login (Duo) with a group account.

  1. Log into Enterprise Web Technical Services using your personal username and passphrase.
  2. After logging in, you will see a list of Group accounts you own. Click the Overview button for the Group account for which you want to request Sitehost.
  3. Click Request Sitehost account. Read the User Agreement and provide the information requested at the end of the User Agreement. Click Request.

Your request will be sent to Web Services Support for approval. Once approved, you will receive an email confirming that your Sitehost account has been created.

2. Check if your IU Web Framework site has customizations

Some common IU Web Framework customizations to check for are described below.

Customized PHP code

First, log into your site in the WCMS, and then open each file in the _php directory. If any files with the .php extension have code in them other than include(1.x/some-file-name.php)or include(1.2.x/some-file-name.php), your site has been customized.

Next, connect to your site on Webserve using SSH or SFTP. If there are any files in your site's published wwws/_php directory not shown on the list of files and directories included with the IU Web Framework, your site has been customized.

Customized Velocity formats

While logged into your site in the WCMS, open each file in the _internal/velocity directory and its subdirectories. If any of these files have code in them other than #import statements or Velocity macro calls (which #LookLikeThis()), your site has been customized.

Customized .htaccess file

Connect to your site on Webserve using SSH or SFTP if you haven't already done so. If the .htaccess file in your site's published wwws directory does not match the .htaccess file included with the IU Web Framework, your site might have been customized.

You can use an online tool like DiffChecker to see if and how your code is different from that shown in the example .htaccess file, which can help you spot possible customizations. Be sure to replace {{ ACCOUNT_NAME }} with your Webserve account name (for example, iuframe), and {{ URL }} with the full URL of your website (for example, iuframe.iu.edu) before comparing with DiffChecker.

Special application files

Connect to your site on Webserve using SSH or SFTP if you haven't already done so. If your site contains any of the following directories or files, it's been customized:

  • A directory named laravel
  • Any files named .dbconfig or .apiconfig
  • Any files or directories not included with the IU Web Framework that contain anything other than your site's regular pages, images, or documents

MachForm

If your Webserve account includes a MachForm installation, follow MachForm migration instructions on Github.

3. Update code in files managed in the WCMS

Log into your site in the WCMS and review the following types of assets for custom PHP code containing hard-coded Webserve paths:

  • Velocity formats in _internal/velocity
  • PHP scripts in _php not included with the IU Web Framework
  • XSLT formats in _internal/xsl
  • Templates in _internal/templates
  • Code chunks in pages and attached sections

If any of the above assets contain custom code with hard-coded Webserve paths, make the following updates, replacing <account> with your Group account name:

  • Replace /ip/<account>/www and /ip/<account>/wwws with /groups/<account>/web
  • Replace /ip/<account>/ with /groups/<account>/
  • Replace www and wwws with web

In the _php folder, edit the .htaccess file and delete the Satisfy Any and Allow from all directives, as they are not used in Apache 2.4.

4. Download files not managed in the WCMS and update their code

If your site contains PHP, JavaScript, or other source code files that aren't managed in the WCMS, you'll need to download them from Webserve to your computer using an SFTP client (see SFTP clients recommended for use at IU).

Once you've downloaded any files not managed in the WCMS, make the following updates to the code in each:

  • Replace /ip/<account>/www or /ip/<account>/wwws with /groups/<account>/web
  • Replace $_SERVER["SCRIPT_URL"] with $_SERVER["SCRIPT_NAME"]
  • Replace all tilde (~) URLs with their equivalent virtual host names, such as www.iu.edu/~iunews to news.iu.edu
  • Update all AuthType directives in any .htaccess files to use the Apache 2.4 syntax

If you're comfortable with the command line, you can use a bash script to locate files that need to be updated. Run this script in your /groups/<account>/ directory (or in the folder on your computer to which you downloaded your site's files via SFTP). This script will generate a results.txt file listing source code files that need to be updated using the steps described in this section.

Note:
In steps 10 and 11 below, you'll use your SFTP client to push these files to Sitehost after publishing your IU Web Framework site from the WCMS.

5. Update cron jobs

If there are any cron jobs running scheduled tasks for your site, you'll need to make the following updates to the code run by these tasks before recreating them on Sitehost:

  • Replace /ip/<account>/www and /ip/<account>/wwws with /groups/<account>/web
  • Replace /ip/<account>/ with /groups/<account>/
  • Replace www and wwws with web

6. Update Transports

Each of your site's Transports must be updated using the WCMS Manager Tools to reflect new Transport names, host names, and server directories.

Note:
You must have manager access to a WCMS site to update its Transports.
  1. Log into the WCMS Manager Tools.
  2. Go to Manage Sites > Manage Transports.
  3. Expand the accordion for the site you are migrating to show its Transports.
  4. Click the pencil icon on the upper right of a Transport to edit it using the steps below:

    For the Transport labeled "TEST":

    1. Set "Transport Name" to Sitehost – Test.
    2. Set "Host Name" to ssh.sitehost-test.iu.edu.
    3. Set "Server Directory" to /groups/<account>/.
    4. Click Submit to save your changes.

    For the Transport labeled "LIVE" or "PRODUCTION":

    1. Set "Transport Name" to Sitehost – Production.
    2. Set "Host Name" to ssh.sitehost.iu.edu.
    3. Set "Server Directory" to /groups/<account>/.
    4. Click Submit to save your changes.

7. Update Destinations

Each of your site's Destinations must be updated in the WCMS to reflect the new directory paths in Sitehost. You should update current Destinations. Creating new Destinations will require updating Content Types.

Note:
You must have manager access to a WCMS site to update its Destinations.
  1. Log into your site in the WCMS.
  2. Go to Manage Site.
  3. Click Destinations in the left sidebar.

    For the Destination labeled "TEST":

    1. Right-click the Destination and click Edit.
    2. Set "Directory" to web.
    3. Click Submit to save your changes.
    4. Right-click the Destination and click Rename.
    5. Set "New Destination Name" to Sitehost - Test.
    6. Click Submit to save your changes.

    For the Destination labeled "LIVE" or "PRODUCTION":

    1. Right-click the Destination and click Edit.
    2. Set "Directory" to web.
    3. Click Submit to save your changes.
    4. Right-click the Destination and click Rename.
    5. Set "New Destination Name" to Sitehost - Production.
    6. Click Submit to save your changes.

8. Update Settings block

You'll need to update the staging URL in your site's Settings block in the WCMS. The Settings block is located toward the bottom of your site's root folder.

  1. Log into your site in the WCMS if you're not already logged in.
  2. Go to Site Content.
  3. Right-click the Settings block in the left-hand file explorer and click Edit.
  4. Set "Staging URL" to <account>.sitehost-test.iu.edu.
  5. Click Submit to save your changes.

9. Run the IU Web Framework setup script on Sitehost-test and Sitehost

The IU Web Framework setup script prepares your Sitehost-test and Sitehost account to serve your IU Web Framework website. Follow the directions below to run the setup script.

Note:
If you're not familiar with SSH or the command line, you can request to have the setup script run for you by contacting Web Services Support.

For your test Sitehost account:

  1. Log into IU's VPN if you're off campus.
  2. SSH into your site using the command line or a tool like PuTTY, replacing <username> with your personal IU username (not the Group account name): ssh <username>@ssh.sitehost-test.iu.edu.
  3. Enter your personal passphrase (not the passphrase for the Group account).
  4. Confirm your attempt to log in with Duo.
  5. Run the following command, replacing <account> with the Group account name: become <account>.
  6. Enter the Group account's passphrase when prompted.
  7. cd into the web directory.
  8. Run the following command: /groups/iuframe/bin/setup_framework.
  9. When prompted, enter your test site's virtual host URL, replacing <account> with the Group account name: <account>.sitehost-test.iu.edu.
  10. Run the following command to list all files and directories: ls -a.
  11. Verify the setup script created the following files and directories:
    1. gwassets/
    2. .htaccess
    3. .user.ini
    4. robots.txt

For your production Sitehost account, follow the steps above, replacing instances of sitehost-test in URLs with sitehost. In step 9, replace the URL <account>.sitehost-test.iu.edu with your virtual URL (for example, iuframe.iu.edu). If you site does not have a virtual host, enter the following URL, replacing <account> with the Group account name: <account>.sitehost.iu.edu.

10. Publish your site to Sitehost's test server and verify it works

Publish your site to Sitehost's test server to confirm your site is working as expected before publishing to Sitehost's public-facing production server.

  1. Log into your site in the WCMS if you're not already logged in.
  2. Go to Site Content.
  3. Right-click the root folder of your site in the left-hand file explorer and click Publish.
  4. Check the box labeled "Sitehost - Test".
  5. Uncheck the box labeled "Sitehost - Production".
  6. Click Publish.
  7. If your site has any files from step 4 (such as PHP scripts or custom .htaccess files) that are not managed in the WCMS, you'll need to publish them from your computer to Sitehost-test via SFTP.
  8. Visit <account>.sitehost-test.iu.edu to verify your site is working as expected. Contact Web Services Support if you're unable to get your site to work on Sitehost's test server.

11. Publish your site to Sitehost's production server and verify it works

To publish your site to Sitehost's production server, follow the steps below:

  1. Log into your site in the WCMS if you're not already logged in.
  2. Go to Site Content.
  3. Right click on the root folder of your site and click Publish.
  4. Uncheck the box labeled "Sitehost - Test".
  5. Check the box labeled "Sitehost - Production".
  6. Click Publish.
  7. If your site has any files from step 4 (such as PHP scripts or custom .htaccess files) that are not managed in the WCMS, you'll need to publish them from your computer to Sitehost via SFTP.

Testing your site on the Sitehost production server requires adding your virtual host to Sitehost without requesting a DNS change. If you are not using a virtual host, then you can view your site on Sitehost by going to <account>.sitehost.iu.edu.

Make a virtual host request

Note:
Only a Group account's owner or proxy can request a virtual host for it.
  1. Log into Enterprise Web Technical Services using your personal username and passphrase.
  2. After logging in, you will see a list of Group accounts you own. Click the Overview button for the Group account for which you want to request a virtual host.
  3. Click Virtual Hosts on the left menu.
  4. Click Request a new Virtual Host on Sitehost.
  5. Complete the form.
    1. Check the box labeled "This currently points to another server" if your virtual host is currently pointing to another server such as Webserve. If you check this box, the DNS change will not take place until you contact Web Services Support to request a virtual host DNS transfer.
    2. The "Launch Date" field is the date the virtual host will be set up on Sitehost.
  6. Click Request.

You will receive a confirmation email when your virtual host request is approved. Allow up to 30 minutes from receiving the confirmation email for the virtual host to be installed on Sitehost.

Visit your site using a test URL

  1. In a web browser, go to https://<website_url>/sitehostmigrationtest, replacing <website_url> with your site's virtual host URL (for example, iuframe.iu.edu).
  2. You will see an intermediate page that says you are about to view your site on the Sitehost production server. Click the virtual host link to proceed.

You will now see your site as rendered by the Sitehost servers. The site title will begin with "Testing - ". Repeat the two steps listed above if clicking the link on the intermediate page does not take you to your site as rendered by the Sitehost servers.

12. Request a virtual host transfer

When you've finished migrating your customized IU Web Framework site to Sitehost, request the transfer of your virtual host from Webserve to Sitehost by contacting Web Services Support with the account name and URL of the site you've migrated.

Changes to a virtual host's configuration take time to propagate through the system. In most cases, your transfer will take effect by 8am the business day after you receive confirmation of your transfer request.