0

I finished development of my ASP.NET application. As database I used SQL Server 2017. I am trying to move the app from localhost to server. I buy hosting but version of SQL Server on hosting is 2014. They sent me that I need downgrade my database to version 2014.

I used this tutorial: https://www.mssqltips.com/sqlservertip/2810/how-to-migrate-a-sql-server-database-to-a-lower-version/

After the first part of the tutorial, I script out the database and get a .sql file. After this I installed SQL Server 2014. Login on both version of SQL Server is using Windows authentication.

When I start the script, I get errors:

Cannot create file 'C:\Program Files\Microsoft SQL Server\MSSQL14.SQLEXPRESS\MSSQL\DATA\RheosDB.mdf' because it already exists. Change the file path or the file name, and retry the operation.

Msg 1802, Level 16, State 4, Line 4
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

Msg 5011, Level 14, State 5, Line 16
User does not have permission to alter database 'RheosDB', the database does not exist, or the database is not in a state that allows access checks.

Msg 5069, Level 16, State 1, Line 16
ALTER DATABASE statement failed.

And at least 50 times like this with changed numbers. As I can see problem is with permission. I try to start SQL Server Management Studio as administrator.

Thank you and regards

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • The error message clearly says: *Change the file path or the file name, and retry the operation.* - did you try that? – marc_s Jan 17 '20 at 11:36
  • Are you really sure you bought SQL Server hosting for a version that's *no longer in mainstream support*? `They sent me that I need downgrade my database to version 2014.` no, they need to give you what you paid for - a supported SQL Server version. – Panagiotis Kanavos Jan 17 '20 at 12:10
  • I don't know, I may be crazy, but the hoster may be doing this to force people to pay for (previously Enterprise only) free features provided since 2016 SP1, ie all supported versions. How can they make you pay for extra storage if you go and enable compression? Or charge you for in-memory tables? – Panagiotis Kanavos Jan 17 '20 at 12:12
  • What is the output of SELECT * FROM sys.databases? – SE1986 Jan 17 '20 at 12:20
  • My hosting provider do me a favor. They use my sql backup database and do the thing. They didnt explain me what they done – Šimun Višević Jan 20 '20 at 14:02

1 Answers1

0

You first create a database on 2014 version and then generate script from your localhost with data ( Ref : https://learn.microsoft.com/en-us/sql/ssms/tutorials/scripting-ssms?view=sql-server-ver15 - "Script a database by using the Generate Scripts option " )

Make sure you generate script as schema + data not schema only.

execute this script on your live 2014 server. it should work

Ketan Kotak
  • 942
  • 10
  • 18