Upgrading Umbraco 7.2.8 to 7.3.0 - c#

I am currently working on Umbraco Upgrade.
My Current version of Umbraco is 7.2.8 and I want to upgrade it to 7.3.0.
I have upgraded successfully but now i am trying to execute project it shows me below error :
Is there anything that have to be changed in database? Because i have upgraded via nuget.
Please help me out from this situation.

1) In the web.config try to set the umbracoConfigurationStatus to emty, this will force a upgrade process:
<appSettings>
<add key="umbracoConfigurationStatus" value="" />
2) In the Web.config check the umbracoDbDSN connectionstring. If you use a .sdf file check if the file exists. Else check the connection.
<connectionStrings>
<remove name="umbracoDbDSN" />
<add name="umbracoDbDSN" connectionString="Data Source=|DataDirectory|\Umbraco.sdf;Flush Interval=1;" providerName="System.Data.SqlServerCe.4.0" />
<!-- Important: If you're upgrading Umbraco, do not clear the connection string / provider name during your web.config merge. -->
</connectionStrings>
3) Your database file is corrupted. restore the .sdf file from a backup, or try the repair tool. http://sqlcecmd.codeplex.com/ see https://technet.microsoft.com/en-us/library/ms172420.aspx
Or the database file is locked or somethings by another process, restart the computer

Related

Error Connecting to DB.mdf when published IIS

I have been searching all over different sources in search on solving my issue.. I've published a website on IIS that I have been working on and this is my first published website on IIS.
I seem to not be able to connect to the database.
I will provide everything that I have done right down here..
Appreciate any help please....
My web.config file in the published website directory C:\FinancialHubTest.
On a side note I also tried adding User Instance=True to my connection string in my web.config file but it doesn't work..
<connectionStrings>
<!--<add name="ConnStr" connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFileName=|DataDirectory|\FinancialHub.mdf;Integrated Security=True" />-->
<add name="ConnStr"
connectionString="Data Source=(LocalDB)\.\IIS_DB;Integrated Security=True;" />
</connectionStrings>
Details of MSSQLLocalDB from cmd
applicationHost file in C:\Windows\System32\inetsrv\config edited with Notepad2.
I'm using FinancialHub as my applicationPool for my published website in IIS
<applicationPools>
<add name="DefaultAppPool" managedRuntimeVersion="v4.0" />
<add name="Classic .NET AppPool" managedRuntimeVersion="v2.0" managedPipelineMode="Classic" />
<add name=".NET v2.0 Classic" managedRuntimeVersion="v2.0" managedPipelineMode="Classic" />
<add name=".NET v2.0" managedRuntimeVersion="v2.0" />
<add name=".NET v4.5 Classic" managedRuntimeVersion="v4.0" managedPipelineMode="Classic" />
<add name=".NET v4.5" managedRuntimeVersion="v4.0" />
<add name="FinancialHub" autoStart="true" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated">
<processModel identityType="ApplicationPoolIdentity" loadUserProfile="true" setProfileEnvironment="true" />
</add>
<applicationPoolDefaults managedRuntimeVersion="v4.0">
<processModel identityType="ApplicationPoolIdentity" loadUserProfile="true" setProfileEnvironment="false" />
</applicationPoolDefaults>
</applicationPools>
My Published Website directory with App_Data having the FinancialHub.mdf file
My SQL Server Object Explorer, the connection only appears when I run my website via Visual Studio 2015 I think that would be running on IIS Express..
I have been getting this error every time I change here and there but I'm really sure why.. Or rather what changes I make to either web.config, etc will cause this error. I check the windows event log too.
I also followed these 2 links on dealing with this issue,
Using LocalDB with Full IIS, Part 1: User Profile,
Using LocalDB with Full IIS, Part 2: Instance Ownership
If there is a need for more information i can provide..
I feel like i have been beating around the bush trying to figure out but i can't seem to solve it..
I really do appreciate any help please. Thank you so much.
You are still using LocalDB even after publishing the application to IIS. LocalDB (SQL Database inside App_Data) is primarily intended for developing and testing purpose only.
You need a real SQL Server when you host the site on IIS. So you need to install SQL Server either in the same server that the application is hosted or a dedicated SQL server. Then attach or copy the existing database to SQL Server.

C# How to deploy/create setup for VS application with localdb?

Im trying to deploy application application with localdb. What I currently achieved is that I created mdf file from my localdb and add it to setup project (Visual Studio Installer). I modified connection of mdf file to localdb database. What I'm worried about this solution, when I'll edit database and install updates on client PC, if the data from mdf file will be lost. Is there a better way how to deploy or is this method valid?
Problem with this method is that I cant reach my stored procedure, even server explorer shows them.
Using VS 2015, SQL Server 2016 and EF 6 in my app.
Connection string, first one was initial one, connecting right to localdb, second one is connecting to mdf file. First one si working correctly, but only on dev machine, second one is having problems.
<connectionStrings>
<add name="MSDBContext" connectionString="data source=(localdb)\MSSQLLocalDB;initial catalog=MSDatabase;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
<add name="MSDBContextFile" connectionString="data source=(LocalDB)\MSSQLLocalDB;attachdbfilename=|DataDirectory|\MSDB.mdf;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
</connectionStrings>

.mdf file missing under the App_Data folder in ASP.NET MVC

I was following the tutorial on creating the Code First Entity Framework model on Asp.NET MVC Application from this tutorial.
As I proceeded, a file with the .mdf extension should have been generated under the App_Data folder in my project (in the solution explorer section). Currently this folder is empty.
I have tried building the project and cleaning it. Moreover I have enabled Show All Files option in the folder. I even did a refresh. The Entity Framework works just fine and is able to connect and retrieve from the database. However the App_Data folder is empty.
Here is are my connection strings:
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-UsingEntityFramework-20161002112829.mdf;Initial Catalog=aspnet-UsingEntityFramework-20161002112829;Integrated Security=True"
providerName="System.Data.SqlClient" />
<add name="MovieDBContext" connectionString="Data Source=tcp:xxxxxxxxxx.net;Initial Catalog=xxxxx;User ID=xxxxx;Password=xxxxxx;" providerName="System.Data.SqlClient"/>
</connectionStrings>
Check your web.config and notice the connectionString and see the data source, maybe it is creating it under your SQL Server not inside the App_Data
The MDF File will be created when the database is created, and since this is a code first, the database will not be created unless you run the application and start connecting to the database, EF will create the database if it doesn't exist and will compare the schema to the schema in the Migrations folder and it will update the database if it is not up to date.
You can also open Nu Get Package Manager and run the command Update-Database to create and update the database.

Trying to replace connectionStrings element for continous deployment in Visual Studio Team Services

I am using Visual Studio Team Services, previously Visual Studio Online, to continuously deploy my web app. I have tried setting up the web.config transformation, I believe it is working after I have changed the configurations setting to Release | Any CPU as instructed here Web config transforms not working with Visual Studio online, VS2013 and Azure .
The issue I believe I am having is more with the transform its self.
Right now I have the following in my web.config
<connectionStrings configSource="connections.config"/>
I want this so I can avoid checking in connections.config and still have my db connections setup locally. What I want to do is replace the above line of code with something like this.
<connectionStrings>
<add name="umbracoDB" connectionString="blah " providerName="System.Data.SqlClient" />
<add name="EFdb" connectionString="blah" providerName="System.Data.EntityClient" />
</connectionStrings>
I am using
<connectionStrings configSource="connections.config" xdt:Transform="Remove" xdt:Locator="Match(configSource)"/>
and it seems to be successfully removing the configSource connectionStrings element. But I am still confused on how to add back my replacement connectionStrings and add elements?
Devin
One thing that you can do is to store your DB connection strings as secret variables in Build/Release and then use the Tokenizer task from Marketplace
to replace the connection string token with actual string.
Tokenizer task has support for the environments in Release Management.
If you want to replace your connectionStrings element during deployment, try usign the Replace transform:
<connectionStrings xdt:Transform="Replace">
<add name="umbracoDB" connectionString="blah " providerName="System.Data.SqlClient" />
<add name="EFdb" connectionString="blah" providerName="System.Data.EntityClient" />
</connectionStrings>

The process cannot access the file \App_Data\ASPNETDB.MDF' because it is being used by another process.

When trying to publish our website on Windows Server 2008 R2, we are seeing the following error. Error 4 The process cannot access the file 'C:\Users\Student\Desktop\CSFP Front-End\App_Data\ASPNETDB.MDF' because it is being used by another process.
We don't understand what else could be using the data file.
web.config looks like this
<connectionStrings>
<add name="FBConnectionString" connectionString="Data Source=SERVER4;Initial Catalog=AITP;Integrated Security=True" providerName="System.Data.SqlClient" />
<add name="ASPNETDBConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\Student\Desktop\CSFP Front-End\App_Data\ASPNETDB.MDF;Integrated Security=True;User Instance=True"/>
</connectionStrings>
<system.web>
It runs fine locally, and the roles and users work as well. "Build Web Site" also works just fine, but when we are trying to publish the website it throws the error. Any ideas?
while publish the project, first detach the database file. Then publish it will work fine. For detaching right click on App_Data->ASPNETDB.MDF, detach...
The simplest solution could be to simply close the .mdf file and restart Visual Studios. I've had to do this when felix's method doesn't work.
Another superstition I try is killing the "SQL Server" process with the Task Manager.

Categories