After deployment: Error 404 and database settings look wrong

Topics: Installing Orchard
Jun 2, 2013 at 4:03 PM
I have created and tested my website in Visual Studio 2012 using the Orchard Source solution (1.6.1) and it is now ready for publishing. This is what I have tried:
  1. Package/Publish SQL tab for project Orchard.Web
    a) Destination database connection (SQL Server on Azure)
    b) Source database connection (SQL Express on dev machine)
    c) Database scripting options: Schema and Data
  2. Orchard.Web project -> right-click -> Publish
    a) Import publish profile from Azure website
    b) Select Publish method: Web Deploy
    c) File Publish Options: all boxes unchecked
    d) There is a warning: No databases found in the project (using SQL Express on the dev machine)
    e) Publish
  3. After that I can see all the deployed folders and files in the Azure wwwroot\ and the destination database now contains a number of Orchard tables.
  4. When I browse the site:
    a) Server Error in '/' Application. 404
    b) In orchard-error-[date].log in App_Data\Logs:
    provider: SQL Network Interfaces, error: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled
    This is weird because I thought the site would be automatically configured to use SQL Server (not local/Express).
  5. In the Package/Publish there is a step that I have ignored because I wasn't sure: the "Web.config transform". I don't see a connection string either in the Web.config of the project in Visual Studio or in the Web.config in wwwroot on the deployed site.
  6. In wwwroot/App_Data/Sites/Default/Settings.txt there is an entry:
    DataConnectionString: server=(localdb)\projects;database=mydbname;integrated security=sspi.
Should I do this instead? (i) Create a new Orchard on my Azure website; (ii) Export content items from dev machine using the Import/Export module; (iii) Upload my customized theme folder manually?

Thanks in advance
Jun 3, 2013 at 7:09 AM
You deployed app_data, and in particular settings.txt, that is pointing to a local database, but you did not deploy the database. The problem seems to be that WebDeploy did not see your local databse. I don't know why it wouldn't, but that is certainly what you need to investigate.
Jun 3, 2013 at 1:40 PM
Thank you. I will continue to try to make it work with Web Deploy.

I assume the Web Deploy wizard looks for a connection string in the Web.config of the project, but there isn't any. I will look into that and make a couple experiments and will post my findings.
Jun 8, 2013 at 1:15 PM
I solved the problem by replacing the connection string manually in Settings.txt in the production site.

My mistake was to think that the deployed application would read the connection string in Web.config and ignore what is in App_Data, because the database is in SQL Server.

As Bertrand LeRoy said, Web Deploy did not see my local database. I worked around this by entering the local connection string in the Package/Publish SQL tab of the project properties.