Sunday, June 20, 2010

Godaddy: IIS6 to IIS7 easy upgrade path for YetAnotherForum


About two years ago, to host some academic content for my college, I signed up for a Godaddy Windows hosting plan with IIS 6 (the only option then). I had installed YetAnotherForum [YAF version 1.9.1.2]
For quite some while now, I wanted to upgrade to the IIS 7 as nearly 90% of the free application that godaddy provides, listed itself as unsupported to my hosting plan. The major advantage of upgrading to IIS 7 was that it supported PHP which enables you to addon some real nice open source applications like wordpress and PhpBB. But the major bottleneck for me not upgrading was the fear of crashing and loosing my registered members in the forums as 1.9.1.2 was outdated and had NO support for Integrated pipeline mode of the newer IIS 7 as opposed to the classic mode of IIS 6. So i spent about a week scouring the YAF forums, few email supports from the people at godaddy and finally decided that its time to take the change. I successfully upgraded my server to IIS 7 and still preserved the forum database pretty easily. I noticed a lot of people who had the same doubts as mine so here's step by step instructions that will get you started.

Step 1:
As a rule, Login to your godaddy hosting manager and request for a complete backup of your databases. The YAF forum should probably be installed on MS SQL server and the other databases are probably on MySQL. Remember to backup both of them. This should take a maximum of 24 hours and they will email you when its done.

Step 2:
FTP your server and for total fool proof method, download the database backup to your hard disk. Also, if feasible, download the entire content on your server to your local hard disk. I had some 100mb of content so it was no big deal. Save them in a secure location.This may sound paranoid, but once a great admin said, "You should be able to restore your server to the last working state anytime". yes, I just made that up ;) But hey, it pays!

Step 3:
Login to your godaddy hosting manager and request the IIS 7 upgrade. Remember, its a one way upgrade and you CANNOT revert back to IIS 6. But trust me, having IIS 7 is much secure and loads of application compatibility. Their update time says few hours, but it took me nearly more than 24 hours for the upgrade. Since my website was simple with few posts and student content, we experienced no major downtime.You will receive an e-mail from Godaddy within a few hours asking you to note down your new database names. This is very important. Take a print out of the same as we will need it later.

Step 4:
After further waiting, you will receive another email from Godaddy telling you that your hosting server has been successfully upgraded to IIS 7. They would also advice you to remap your database connection strings within 24 hours to avoid loosing connectivity.

Step 5:
Now, when you try accessing your webpage(this should work fine) and the forum, you'll see an error page, something like Internal server timeout or host unreachable. Dont Panic, as this is quite common because YAF 1.9.1.2 is configured to run in classic pipeline mode and doesn't recognize the IIS 7 pipeline mode. Simply put, after the upgrade, there are two main changes to your installed applications.

  • The connection string - i.e the database name it points to
  • The mode of accessing the application pool (i.e integrated or classic)

Here's how to make it work.
FTP to your hosting root, navigate to the place where you have your forum installed, usually the root or within a folder. Download the web.config and the Yafnet.config files to your computer. Make a copy and backup the originals.

Step 6:
Open your web.config file via notepad or your favorite editor and copy the following code before the "</configuration>" end line.


<system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules>
            <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
            <add name="YafInitModule" type="YAF.Classes.Base.YafInitModule, YAF.Classes.Base"/>
            <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter" preCondition="managedHandler"/>
        </modules>
        <handlers>
            <remove name="WebServiceHandlerFactory-Integrated"/>
            <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
            <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
            <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        </handlers>
    </system.webServer>



Step 7:
Open the Yafnet.config file and here we will be pointing the connection strings to the new database names that we received via email. Look for the following string

user id=DBUser;pwd=DBPassword;data source=youroldhostname;initial catalog=DBName;timeout=90

Here, you will have your User ID and password. Leave them as they are. Look at the "Data source" string, replace the old name with your new DB name. i.e change youroldhostname to yourhostnewname and save it.

Step 8:
Upload the two config files back to your forum installation directory on your servers and if prompted, replace the old existing files with the ones we have edited.

Step 9:
Clear out your browser cache, refresh and try loading your webpage now. The forum should work just like the way it was before the upgrade! All your posts and users remain intact. Hope this helped.

2 comments:

  1. How I wish you'd written this two months earlier. I wasn't able to get the upgrade to work, and as a result of some seriously bad advice from GoDaddy employees, no longer have a working forum at all.

    At this point I'm just looking for a list of the files that I can delete from my web so I can start all over again from the getgo. :(

    ReplyDelete
  2. @Above
    Oh I am very sorry :( hope u are able to get ur site up and running again!

    PS: Sorry for the late response :(

    ReplyDelete