How to Get Your Starter Kit Launched on a Web Host

The most common problem for the novice Starter Kit user is moving their site from their personal computer to their web host.

A common stumbling block is the database configuration.  When you run the StarterKit on your personal computer a database file is created in the App_Data folder of your site and everything works fine. When you move the site to your web host this database will not work for you.  You are going to have to copy the information from the database on your personal computer and replicate it to your Web hosts SQL Server Database either through a backup and restore proceedure (which is the way I like to do it) or through running a script against the hosted database.  Check out the steps below for the details.

I am assuming you have your site up and running just fine on your local machine and here are the steps to move to a hosted environment.

Basic Steps:

1) Get a web hosting account.  You already have one you say?  Great, but all web hosts are not created equal.  Not to knock anyone in particular too much but some of the large (and inexpensive) web hosts (godaddy, 1and1, etc.) make it a challenging to get your starter kit to work.  In particular, some starter kits such as CSK and Club Starter Kit 2.0 among others require that you have a full trust rather than a medium or partial trust environment on your Web host.  This is not going to be something that you can change – either your host provides it or they do not.  There are several hosts that specialize in .NET hosting (such as discountasp.net, Ultimahosts.net among many more) and they will make your life much easier when you want to go live with your web site.  It is up to you but you may be able to save yourself a lot of time and anguish by researching which web hosts work well with your particular Starter Kit.  In addition, many of the hosts that specialize in .NET hosting have an option in their control panel where they will automatically install a blank Starter Kit into your hosted space.  Now this is not going to help you if you have already customized your Starter Kit locally but if you are just now getting started there is no easier way to get live on the Internet.

2) Create a blank SQL 2005 database on your Web Host.  The exact steps to do this are going to vary by Web Host by will be accomplished from your online control panel.  Be sure to write down the name of the database you created.

3) Create a user for that database on your Web Host.  Again the exact steps are going to vary but it will be accomplished through your control panel and you will need to write down the user name and password you created.

4) Created a backup of your local Starter Kit’s Database.  This should be located in the App_Data folder of you Starter Kit and will be a .mdf file.  I recommend using SQL Server Management Studio Express to do the backup (it can be downloaded for free here: http://msdn.microsoft.com/vstudio/express/sql/download/) If you have not done so already from SQL Server Management Studio you will need to “attach” the database that you would like to back up.  This is done from the main screen in SQL Server Management Studio, just right click on the databases folder and select “attach” then browse to the file location of your database.  Once the database is attached right click on it and select “backup.”  This will create the .bak file that you need to replicate your local database onto the Web Host.

5) Restore the local backup to your Web Host.  Depending on your Web Host you either need to upload the .bak file to your hosted space and then do the restore or you can do the restore directly from the local copy of the .bak file you created.  This will be accomplished through your control panel and there is usually a “maintenance tools” option for your SQL database where you can select “restore.”  If all goes well your local database is now replaced onto your host.

6) Modify your connection string in your web.config file to point to the online SQL database you created.  When you initially install your Starter Kit the connection string section of your web.config file will look something close to this:
<connectionStrings>
<add name=”LocalSqlServer” connectionString=”Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf” />
</connectionStrings>
You need to modify this to point to the SQL database on the Web Host. It should take the form of:
<connectionStrings>
<remove name=”LocalSqlServer”/>
    <add name=”LocalSqlServer” connectionString=”Data Source=72.52.xxx.xxx;Database=xxxxx;User Id=xxxxxx;Password=xxxxxxx;TrustedConnection=False” providerName=”System.Data.SqlClient”/>
</connectionStrings>
The specifics that you enter here will be the info that you wrote down from steps 2&3 above and the “Data Source” info will come from your Web Host.

7) Upload you web site.  Using either Visual Web Developer or your favorite FTP client, upload your website files to your Web Host.

8) You are done!

Comments

  1. Thanks for this – I’m nearly there :/ I’m with 1&1 and I’m getting an error

    “The backed-up database has on-disk structure version 611. The server supports version 539 and cannot restore or upgrade this database”

    Any ideas? This would be so much easier than the other methods I’ve seen (and never got working)

    Cheers

  2. Neil – You are getting that error because you are trying to restore a MS SQL 2005 database to a 1&1 MS SQL 2000 Server. 1&1 started offering MS SQL 2005 Severs and you should see if can add it to your hosting plan (unless you are in the UK where I still don’t think they offer it yet.)

    Otherwise you should try the MS SQL Server Database Publishing Wizard (download from – http://www.microsoft.com/downloads/details.aspx?familyid=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en )
    The wizard is designed for your situation – getting a SQL 2005 database transferred to a SQL 2000 server in a shared hosting environment.

  3. You are a star :) and I’ll be digging this; It’s unbelievable how many people are having these problems trying to host MS Starter Websites that use SQL Express on hosts that never do… Even transfering a basic login page to a remote host becomes a major undertaking – really makes you appreciate how easy it is to deploy PHP + MySql apps :) Thanks

  4. I am happy to help – I agree that MS did not make publishing as easy as they should have which is why I made this blog. I banged my head on the same problems that every first timer does and wanted to share what I learned along the way. Best of luck!

  5. Hi Admin,
    I have upload the aspnetdb.bak on my Web space. All is ok. ! :)

    On my Local computer, I am able to create a user on my database (On my Web space). But, when a upload my projet on my hosting. I have this error.

    An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)

    How to association a connetion string to my CreateUserWizard ?

    Thank for your help.
    Desperate user !!!!

    Francis

  6. Francis,

    Do you get this error when you access your site over the internet or when you are using visual web developer to work on your site? After uploading the .bak file were you successful in restoring the database to your hosted space? Did you enter the IP address, user name and password for your database into the connection string?

    Let me know and I can try to figure it out.

    jason/ admin

  7. Hi Jason,
    Thank you for your answer. :)

    I will have another question.

    When I create an user. (Name, Lastname, Postal Code, Phone, City, ….)
    And I want to make a list of my users.

    The better place to put this informations is in table aspnet_Users or in a new table ?

    Thank for your help
    Francis

  8. Francis,

    If I understand your question your correctly you are looking to store additional information about users (name, address, phone #, etc) than the basic data from the CreateUserWizard?

    I would recommend creating a new table in the database (something like aspnet_NameAddress) where you store the additional fields and then use the UserId field as the primary key.

    Jason

  9. Hi Jason,

    Could you help me with a problem plz. I am trying to run the club starter kit. I have it working on my local computer but I’m having problems with sql server express. So I used the database explorer in VWD to connect to my host server. I have the database all set up I used aspnet_regl and sql management studio to club add the sql script. It works fine on my local computer even though I’m connected to my hosting database but once I try and run from from internet explorer I get an error. Is this because of the trust issue? Any help would be appreciated.
    Thanks,
    ciaran

  10. Ciaran,

    It could be a trust issue or a virtual directory/ application folder issue.

    Have you contacted your host or do you know if they are medium or full trust? If medium trust you may have problems with the club starter kit.

    That being said it looks like you have deployed the site to a subfolder in your hosting directory if so, you need to set that folder as an application folder from your web hosts control panel for the club starter kit to work.

    Exactly how to do that depends on your web host but their customer service should be able to help you out.

    Let me know if that works.

    Jason

  11. Hi Looking for some help….I have an account with Godaddy.com and I’m stuck on step 5) Restore the local backup to your Web Host.

    I learned the Hard way that Godaddy does not let you restore any backup of your DB unless the DB was originally create on their DB server first..then you could create a backup and restore…so I’m stuck how can I build the DB on GoDaddy server to be exactly like the local DB?

    Please Help!!!

  12. Shaolin – For GoDaddy the recommended way to upload your database schema and data is to use the Database Publishing Wizard from Microsoft (http://www.microsoft.com/downloads/details.aspx?familyid=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en)
    With it you can upload the data and schema from your local database into the blank hosted database you created at GoDaddy.

  13. Thank you for you quick response…I have been trying to set up the Database wizard since yesterday….I’ve triple checked my settings..and I keep getting an error message:

    Invalid web service username and/or password

    I’ve even gone to godaddy support and still unable to gain access….I’m going to call GoDaddy check things out…I guess I need to get this resolved first. Keep your fingers crossed..by the way thanks again…

  14. Unbelievable…I’m getting no help from their tech support regarding connecting to the Publishing Service using Database Publishing Wizard. Is there another way to build my DB on the host server?

  15. Just thought of something….could I build my host DB by copying the SetupDatabase.Sql file and running it the query anaylzer within the host SQL DB?

  16. Yes – you can use the Database Publishing Wizard, SQL Management Studio Express or perhaps the SetupDatabase.Sqlto create the *.sql file that you should be able to run against your host SQL DB.

    As far as GoDaddy is concerned – that is a pretty typical experience from them. If you aren’t locked in with them you might want to explore your hosting options…

  17. Yeah unfortunately…I’ve already paid for 1 year :( I didn’t think it was going to be this bad.

    alright…well if by executing the contents of SetupDatabase.sql is going to build my host DB…then that part is done….I’ve continued with steps 6 and 7…when testing my site..I’m now getting the following:

    Server Error in ‘/’ Application.
    Parser Error
    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

    Parser Error Message: The file ‘/MasterPage.master’ does not exist.

    Source Error:

    Line 1:
    Line 3:

    Source File: /mysite/default.aspx Line: 1

  18. Line contained the following in red font:

    Page Language=”VB” MasterPageFile=”~/MasterPage.master” AutoEventWireup=”true”

    Note: left out the special symbols out of the beginning and end of it…

  19. ahh…ok I ended up replacing the tilde(~) with a period in the default.aspx page….reloaded now getting the following:

    Server Error in ‘/’ Application.
    The file web.sitemap required by XmlSiteMapProvider does not exist.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: The file web.sitemap required by XmlSiteMapProvider does not exist.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [InvalidOperationException: The file web.sitemap required by XmlSiteMapProvider does not exist.]
    System.Web.XmlSiteMapProvider.CheckSiteMapFileExists() +2603704
    System.Web.XmlSiteMapProvider.GetConfigDocument() +226
    System.Web.XmlSiteMapProvider.BuildSiteMap() +58
    System.Web.XmlSiteMapProvider.get_RootNode() +15
    System.Web.UI.WebControls.SiteMapDataSource.GetNodes() +229
    System.Web.UI.WebControls.SiteMapDataSource.GetTreeView(String viewPath) +35
    System.Web.UI.WebControls.SiteMapDataSource.GetHierarchicalView(String viewPath) +32
    System.Web.UI.HierarchicalDataSourceControl.System.Web.UI.IHierarchicalDataSource.GetHierarchicalView(String viewPath) +10
    System.Web.UI.WebControls.HierarchicalDataBoundControl.GetData(String viewPath) +25
    System.Web.UI.WebControls.Menu.DataBindItem(MenuItem item) +56
    System.Web.UI.WebControls.Menu.PerformDataBinding() +50
    System.Web.UI.WebControls.HierarchicalDataBoundControl.PerformSelect() +85
    System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
    System.Web.UI.WebControls.Menu.DataBind() +4
    System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
    System.Web.UI.WebControls.Menu.EnsureDataBound() +40
    System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +22
    System.Web.UI.WebControls.Menu.OnPreRender(EventArgs e, Boolean registerScript) +15
    System.Web.UI.WebControls.Menu.OnPreRender(EventArgs e) +25
    System.Web.UI.Control.PreRenderRecursiveInternal() +80
    System.Web.UI.Control.PreRenderRecursiveInternal() +171
    System.Web.UI.Control.PreRenderRecursiveInternal() +171
    System.Web.UI.Control.PreRenderRecursiveInternal() +171
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

    I feel I’m so close :(

  20. Does the web.sitemap file exist in the root of your web space? Is the path to web.sitemap correct in you web.config file?

  21. Good news!! got about 99% of the site up. I ended up going into IIS settings within Godaddy account created a virutal directory within Content Root I set that directory as applicaton root..transferred my files into that folder…and the site uploaded except for 1 page which used to be the items.aspx which i renamed as services.aspx and modified to my needes…this is the only page not loading correctly getting error message below:

    Server Error in ‘/Law’ Application.
    Keyword not supported: ‘trustedconnection’.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ArgumentException: Keyword not supported: ‘trustedconnection’.

    Source Error:

    Line 72: Public Overrides Function GetChildCategories(ByVal parentCategoryId As String) As List(Of Category)
    Line 73: Dim list As New List(Of Category)
    Line 74: Dim con As New SqlConnection(connectionString())
    Line 75: Try
    Line 76: con.Open()

    Source File: d:\hosting\aybarra01\Law\App_Code\Catalog\SqlCatalogProvider.vb Line: 74

    Stack Trace:

    [ArgumentException: Keyword not supported: 'trustedconnection'.]
    System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +4905476
    System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +98
    System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +55
    System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +24
    System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +200
    System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +62
    System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4
    System.Data.SqlClient.SqlConnection..ctor(String connectionString) +24
    SqlCatalogProvider.GetChildCategories(String parentCategoryId) in d:\hosting\aybarra01\Law\App_Code\Catalog\SqlCatalogProvider.vb:74
    Catalog.GetChildCategories(String parentCategoryId) in d:\hosting\aybarra01\Law\App_Code\Catalog\Catalog.vb:43
    ItemsPage.Page_Load() in d:\hosting\aybarra01\Law\Services.aspx.vb:28
    System.Web.Util.CalliHelper.ArglessFunctionCaller(IntPtr fp, Object o) +8
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +8664611
    System.Web.UI.Control.OnLoad(EventArgs e) +99
    System.Web.UI.Control.LoadRecursive() +50
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

  22. looks like I need an underscore between trusted and connection within the web.config file however now I’m getting another error now:

    Login failed for user ‘MY_DB2009′.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: Login failed for user ‘MY_DB2009′.

    Source Error:

    Line 74: Dim con As New SqlConnection(connectionString())
    Line 75: Try
    Line 76: con.Open()
    Line 77: Dim cmd As SqlCommand
    Line 78: If [String].IsNullOrEmpty(parentCategoryId) Then

  23. Congrats on the progress.
    Is this problem only for services.aspx?
    Clearly a SQL connection issue but that is odd if the rest of the site is working.
    I assume that MY_DB2009 is your MS SQL DB? You may try changing:

    Line 74: Dim con As New SqlConnection(connectionString())

    to

    Line 74: Dim con As New SqlConnection(connectionString)

  24. actually…I had a typo in the data source….I’m able to pull up services.aspx file…now I’m at 99.9% complete… I have one more thing. Apparently when I modified services.aspx which use to be items.aspx I did modifications to the ITEMS.XML file…to change the items and pictures now that services.aspx is up it looks to be pulling that default data that originally came with the starter kit….I’m assuming that by default the start kit pulls xml data…and not from the DB when on local host….any way I can get it to do the same when it on the hosted server?

  25. I figured it out!!!…the welcome.htm tells you how to switch from SQL to XML providers…..YES!!!

    Jason….I would like to thank you very much for taking the time to help me out with this!!!

    You didnt have to reply to any of my requests….but you stuck this out with me!!! I am very grateful….

    If its of any concern…I also asked for help on ASP.net forums around the same time frame of my initial posting…and no one ever replied to me…on the other hand….you help me with more than you can ever imagine.

    Thank you so much….I’ll be continue to come back from time to time for your help :)

  26. Congrats! It often seems like more of a challenge to these sites up than it needs to be, which is why I try to help out. Best of luck with your site.

  27. I am having a very strange issue myself… When I publish my site to my hosting provider I must place it in a sub-folder, since they do not allow me to setup the root or home folder as an application directory through IIS. My problem is that the links within the sitemap do not work. They work fine on my development computer though. Some how there is an extra folder in there. Instead of seeing http://www.mysite.com/page.aspx, I see http://www.mysite.com/myfolder/page.aspx. I feel like I have been banging my head against the wall and nothing seems to be fixing it.

  28. Are you using relative or absolute sitemap referneces? Relative references should still work for you. Post specifics of your setup/ sitemap if you would like more help.

  29. Ok, well guess it doesn’t like me pasting things in here… so I will try to describe.

    All of my site map nodes use the “~/” in front of the page name. Like this: url=”~/Default.aspx”. My hosting account does not allow my root folder to be setup as an application folder, so I have a subfolder and have all of my pages within there. My Domain name is configured to point to that subfolder as its root folder.

    I’m not sure what other information to give you, but I appreciate any help you can give me…

    Brian

  30. add name=”XmlSiteMapProvider” description=”reads XML files” type=”System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” siteMapFile=”web.sitemap” securityTrimmingEnabled=”true”

  31. Brian – First have you tried using just Default.aspx, etc without the ~/? Second – Is your only problem related to your sitemap or are there other issues as well? I wonder because perhaps your subfolder is not setup correctly as an app folder? Third – You could try getting a free trial hosting account from the guys at aspkit.net and testing your website there to confirm that the issue is isolated to your current hosting provider.

    If none of that works – you can email me some of your site files to admin@aspstarterkit.com and I can take a look.

  32. I’ve tried just about everything, including without the ~/. I think I have found that the issue is with my hosting provider. Eventhough they state I am unable to setup my root folder as an application folder, by moving my site to this location I was able to get to my other pages using the sitemap.

    Thanks for your suggestions.

  33. Hope you’re still visiting this article since deployment in GoDaddy is really driving me nuts.. Right now, their econo-hosting package only gives 1 database setup.. Since starter kit utilizes two databases (Personal.mdf and AspnetDB.mdf), i’m clueless on how i’m going to deploy my site.. Hope you can help me dude, thanks in advance!

  34. You can combine the two databases into one and then use that one database with your GoDaddy account. To accomplish this you must run a SQL script on your aspnetdb database and, second you must modify your web.config file settings. Microsoft has a download for the sql modifications that must be made to the aspnetdb.
    Here’s a link to the Microsoft download:

    http://www.microsoft.com/downloads/details.aspx?FamilyId=2EE85ED4-7613-47E2-8375-17222B150E4F&displaylang=en

    Run the Microsoft SQL script on your aspnetdb database (use query analyzer to do so) and it will add the tables personal.mdf contains in your aspnetdb.mdf file.
    Next you need to modify your section in your web.config to point to just one database. Thus both the LocalSqlServer and Personal connection strings need to point to aspnetdb.

Speak Your Mind

*