Umbraco migration from SQL Server 2012 to SQL Server 2008 R2 - sql-server-2012

I need to migrate from my home SQL Server 2012 Express server to SQL Server 2008 instance at my hoster.
I tried to save backup my server and restore db on hosters server, but server threw exception about SQL Server version compatibility.
Then I have gone to another way and installed on my server SQL Server 2008 R2 (v10.50). In Management Studio, I have connected to both servers and I have made export data from SQL Server 2012 to SQL Server 2008 R2. Exporting was successful and I was happy.
Then I have edited my web.config and IIS settings for my site. I have opened my website and logined to umbraco. All was well, but after I have edited my doctype and clicked save. Umbraco has shown me the YSOD page. With text similar to this:
Can`t insert value NULL in column "id" the table "MyTable.dbo.umbracoLog"; in column denied values NULL. Error in INSERT.
I can`t understand how to fix this problem.
P.S.: I can`t attach photo because my karma is too low, but I can write links. This is the screenshot of YSOD. It is write on Russian =)
http://s017.radikal.ru/i404/1402/1c/69baa15293e3.png
Regards, Anton (Siberia)

You need to generate scripts and data inserts for your target database version (2008). See the following post for details:
How do I generate insert statements with Sql server 2012?

Related

SQL Server 2012 Database restore error

I am trying to restore a database backup from SQL Server 2008 R2 to SQL Server 2012 Standard. It keeps failing with the error seen here: http://screencast.com/t/UWC58GrVnWI
The web server is: Windows Server 2012
I tried renaming the file.
I tried to restore on another server
on SQL 2012 and it worked fine
I tried to restore on another
server on SQL 2008 R2 and it worked fine.
Considering above symptoms, I strongly feel the database .bak file is good. It only fails on this web server. What might be the reason?
If you read the error message you will find out that it is clear - the location is invalid. Now, if you check the path of folders and know the basics of how windows file systems work.... guess what, you find out that this is exactly true.
Fix the location. Done.

how to attach .mdf file to sql server 2008 EXPRESS

I have .mdf files created using SQL SERVER management studio in another computer and wish to attach the same to SQL SERVER 2008 EXPRESS in another computer. How should I do so?
I tried this method :How to: Attach a Database File to SQL Server Express
but then it shows an error that the database cannot be created due to compatibility issues.
Msg 948: The database xyz cannot be opened because it is version 706.
This server supports version 655 and earlier. A downward path is not
supported..
....
This basically means your SQL versions don't match. For example, if you backup a database on SQL 2012, you can't restore it to 2008. In your case Version 706 is a database file from Sql Server 2012 and Version 663 is a database file from Sql Server 2008R2 (with some SP).
You can either install SQL Express 2012 to attach the MDF, or if you can't do that, you would have to script out your schema and data and create the DB from scratch.. Unfortunately there's no way to 'downgrade' and MDF back to an older version of SQL.
The message is very clear:
The database MDF file is version 706. Your server understands version 655 . Which means, despite to your claim to the contrary, that you are connected to a SQL Server 2008.
Install a SQL Server 2012, connect to it, and attach your database.
Please pay attention during the installation process to the instance name you choose and make sure you connect to that instance.
You can also check now what instances you have installed, look at what services you have on your system.
SELECT ##VERSION AS 'SQL Server Version'

Error: Can't attach DB to SQL Server 2012

I have SQL Server 2012 and I'm trying to attach a db which was previously used with SQL Server 2012, surprisingly I'm getting the following error:
The database 'DatabaseName' cannot be opened because it is version
706. This server supports version 622 and earlier. A downgrade path is not supported.
I don't really understand how this could happen since like I said it was used with same 2012 version. What am I doing wrong? How can I make it work? Please explain in detail how this can be resolved.
Thank you!!
The error sounds like the server you are trying to attach the database to is not SQL Server 2012. This may be the version of Management Studio / Management Studio Express you're using, but I suspect SELECT ##VERSION; will tell you something different. It may just be a connection string mixup if you have multiple instances of SQL Server installed, otherwise you should download and install SQL Server 2012 Express from here.
#source
It sounds like you had the following configuration and source databases:
SQL Server 2008 SP3 (ver 10.0...) - database engine
SQL Server Management Studio 2012 (ver 11.0...) - management tools
a database that was created with SQL Server 2012 (version 706)
As mentioned you could install SSMS for SQL Server 2008 (after you uninstall SSMS for SQL Server 2012). Then you would have to script your database for that version and re-run the script via 'Tasks>Script...', remembering to set the target server version as shown below.
After scripting you can then use the import/export wizard to export and then inport the data into the new (downgraded database), assuming the database had no 2012-only datatypes (such as sequences).
Another consideration is database compatibility level as shown below. You can have a SQL Server 2012 instance which hosts databases with various compatibility levels.
Using SELECT ##VERSION works very well for me. Your Database Engine is connected to a 2008 DB which certainly doesn't allow you to attach. Once I change my Database Engine to connect to 2012 DB, it works for me.
Check your Database Engine connection. You can be working on 2012 Management Studio yet connecting to 2008 DB. This is what happened to me and I have solved it use SELECT ##VERSION.

problem in connecting studio management to sql server

I had installed SQL Server 2008, but faced some complications with that. I then installed SQL Server 2005, and now installed SQL Server Management Studio for SQL Server 2005 successfully.
I am not able to connnect to the server name it suggests.
TITLE: Connect to Server
Cannot connect to POONAM-C586A95C\SQLEXPRESS.
ADDITIONAL INFORMATION:
This version of Microsoft SQL Server Management Studio Express can only be used to connect to SQL Server 2000 and SQL Server 2005 servers. (Microsoft.SqlServer.Express.ConnectionDlg)
It doesn't show any other option of SQL Server name, though I changed the name as I remembered but for no good.
How can this be solved?
It sounds as if you're trying to connect to the 2008 instance with the 2005 SSMS. It's not clear whether you un-installed the 2008 instance.
Suggest installing the SQL Server 2008 SSMS.
Confirm/modify as needed that you're running the SQL Server instance that you require. This will show you which instances are available.
I would also check to make sure that you're connecting to the correct port. I'm come across a similar error before and the solution was to specify the port to connect to, i.e.
compname\instancename,portnum

Sql Server 2000 trigger that references a Sql Server 2008 database fails

We have a Sql Server 2000 database application that needs to update our applications Sql Server 2008 database when certain tables are changed. For this, we use a trigger on the Sql 2000 server that fires a stored procedure on our Sql 2008 server. When trying it from SMSS, I get this message:
The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.
Our application used to use a Sql Server 2005 database, but we upgraded servers this weekend. The linked server objects have the same configuration as on the old server. Here is my DTC configuration. Is there anything else that could go wrong?
dtc configuration http://yourcls.com/dtc-configuration.png
Google came up with this knowledge base article for me. From your screenshot, it looks like you've got DTC configured right (though I'm skimming, definitely double check it). Have you checked your firewall settings?
It turns out the same DTC security configuration window on our Sql 2000 server did not have any network DTC access enabled. This apparently worked just fine with our old server, but when we upgraded to Server 2008 and Sql Server 2008, this needed to be enabled on BOTH servers. It is a mystery.