The mdf file is set to SQL Server 2012 compatible level (Not 2016). If you have SQL Server 2014, just attach it and set the compatible level to 2008.
Thanks for your repsonse. I am pretty sure the the default one which is being added in the App data folder of the main site when you use nuget packages to add commerce server to a cms site is a 2016 DB.
Please see the error message below when we try to attach the DB in our SQL.
Try to connect to (LocalDB)\MSSQLLocalDB, or SQL Server instance instead. I'm using SQL Server 2014 and I have absolutely no problem with attaching EPiServer.Commerce.dll to those two.
Connecting to the database is not an issue. The following connection works fine for us without any issues and we can run the site and it is loading correctly.
<add name="EcfSqlConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|EcfSqlConnection_54905ff3.mdf;Initial Catalog=EcfSqlConnection_54905ff3;Connection Timeout=60;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
However in our production enviornment we would need to be able to attach the DB to in the SQL management studio (to an sql instance) to be able to setup maintenance scripts and running queries on tables.
You can download the dbs we have got from the following location and try to attach it in your SQl server instance and let us know if it works
I honestly don't know about your file, but this is from my freshly installed site:
Could it be that the visual studio version and/or sql server version installed can affect this by changing properties on the mdf file when it is added/used in the project?
Perhaps you have SQL Server (Express) 2016 installed on your development machine and it automatically and silently upgraded the database to 2016 version when you installed the site.
Thanks for the input. Your analysis is most likely the case. I can restore the Db provide by Quan without any issues. Will check my local configuration and see where it is upgrading the database.
Thanks for your help on this.
Did you ever figure this one out? We're having the exact same problem.
Yes, if you read the comments above. My machine had a different version of SQL express or similar attached to the visiual studio which was causing this issue when the sql scripts were being run.
I was able to use the version supplied by Quan above.
Thanks. However, I was thinking of a more permanent solution, i.e. some way to prevent the database from being upgraded to 852 when installing the site.
I had the same issue when I installed commerce site with Visual studio 2015 because VS 2015 data tools have SQL Server 2016 LocalDB installed on my PC. I have installed VS 2013 with data tools which installed SQL Server 2014 and 2012 LocalDBs. When installed commerce site usinbg visual studio 2013, I got the SQL data files(.mdf, .ldf) of SQL Server version 2014 and I am able to attach them on our customer's environment which has SQL Server 2014 running. Hope this helps someone facing similar issue.
Niklas Uhlin, You could use DbUp and script the database on live.
We are starting a new Episerver Commerce project and have installed the version 9.23.0.
Seems like the default database which is provided for commercer (in App Data folder) with this is SQL 2016.
The folllowing system requirements mention that lowere versions are also supported.
Is there a 2014 or lower version 2008 R2 available which we can use.
Would installing a lower version of EPiserver commerce provide us with this.