Possible to restore a backup of SQL Server 2014 on SQL Server 2012? - sql

I know that you can't (at least not easily) restore a SQL Server 2012 backup on SQL Server 2008. But how does it work for SQL Server 2014 to SQL Server 2012 ?
On database level there is the property to adjust the compatibility mode to any other SQL Server version.
How does this helps or work ? Will it only disallow the features from 2014?
To be honest I already tried to restore a backup, but 2012 didn't recognize the datafile, so I couldn't click ok Button to start the restore procedure.
Did I miss some important option ?

You CANNOT do this - you cannot attach/detach or backup/restore a database from a newer version of SQL Server down to an older version - the internal file structures are just too different to support backwards compatibility. This is still true in SQL Server 2014 - you cannot restore a 2014 backup on anything other than another 2014 box (or something newer).
You can either get around this problem by
using the same version of SQL Server on all your machines - then you can easily backup/restore databases between instances
otherwise you can create the database scripts for both structure (tables, view, stored procedures etc.) and for contents (the actual data contained in the tables) either in SQL Server Management Studio (Tasks > Generate Scripts) or using a third-party tool
or you can use a third-party tool like Red-Gate's SQL Compare and SQL Data Compare to do "diffing" between your source and target, generate update scripts from those differences, and then execute those scripts on the target platform; this works across different SQL Server versions.
The compatibility mode setting just controls what T-SQL features are available to you - which can help to prevent accidentally using new features not available in other servers. But it does NOT change the internal file format for the .mdf files - this is NOT a solution for that particular problem - there is no solution for restoring a backup from a newer version of SQL Server on an older instance.

Sure it's possible... use Export Wizard in source option use SQL SERVER NATIVE CLIENT 11, later your source server ex.192.168.100.65\SQLEXPRESS next step select your new destination server ex.192.168.100.65\SQL2014
Just be sure to be using correct instance and connect each other
Just pay attention in Stored procs must be recompiled

Related

How do I migrate the SQL server data to an older engine?

Here's my current dilemma: I need to migrate the database, including the data, from SQL server version 13 to version 12. The source is on an Azure box and the destination is on my local box. I can't install SQL server 2016 on my local box; that isn't an option. How do I do this?
I would recommend you to use SQL Database Migration Wizard
Can you try using SqlPackage to Export the Azure database?
I've recently done the opposite of you, exporting SQL Server 2012 databases to Azure SQL V12. I used a combination of SqlPackage and Visual Studio with SQL Server Data Tools.
Basically I made a SQL Project based on the source databases (SQL Server 2012 hosted), set the target platform to Microsoft Azure SQL V12 and fixed any errors and warnings that wasn't supported in Azure SQL V12.
I then did a schema compare between the source database and the SQL Project. With this I generated a script which I ran against a copy of the source database.
Lastly I used SqlPackage to make a .bacpac from the database I ran the script against, which I could then deploy to Azure.
If you do the opposite maybe it'll work. It is important that when working with Azure SQL that you have updated software.
It seems that the answer is in insert scripts, which I didn't realize was a thing. There's good information at How to generate an INSERT script for an existing SQL Server table that includes all stored rows?
Edit: Another answer says NOT to generate INSERT scripts to copy all the data from a DB. I tried it and it seemed to fail because of some truncation in the script itself (it ended up being over 11 GB). A developer I'm working with suggested the bcp utility (documentation at this link), which I have not yet tried.

How can I restore a database backup file (.bak) from SQL Server 2012 into SQL Server 2008 Express?

A database that was originally from SQL Server 2008, was restored into SQL Server 2012. A backup from SQL Server 2012 was made and I am trying to restore it on my local SQL Server 2008 Express. However I get an error 'Specified cast is not valid' (SQLManagerUI).
I have generated an SQL Script from 2012 and set it so that it will generate with compatibility to SQL Server 2008. However it is a large sql file, around 700mb.
I recall before that I had tried to run a script of that size before on my local SQLExpress and also got an error.
Is there a way I can get a "large" database from SQL Server 2012 into SQL Server 2008 Express?
Thanks to Marc and Aaron for providing the answers.
The quick answer is no, it's not possible to restore a backup file from a higher version to a lower version of SQL Server.
A work around would be to generate the scripts to create the database.
You can target the script generation to a lower version.
Please see comments above for more information.
Links:
Why an SQL Server Database from a higher version cannot be restored onto a lower version of SQL Server?
Create Database in SQL Server 2012, Script and Use in 2008?
Couple things to add that might be helpful to folks
When scripting large databases using scripting wizard in SSMS it’s really important to check the execution order and be willing to re arrange it manually. Older versions of SSMS had this problem because they (probably) relied on sp_depends that has a bug.
What I’ve found really useful in such cases are tools like ApexSQL Diff that you can use to read database backups and generate scripts that are in correct execution order.
SQL Server database backup restore on lower version
One thing that none of the methods will catch is the thing Aaron mentioned about using functions specific to higher version.
A better option than using the SSMS scripting wizard is to use a similar tool available on Codeplex called SQL Database Migration Wizard - http://sqlazuremw.codeplex.com/releases/view/32334. You want the latest version v4.x to work with SQL Server 2012.
The tool is originally intended to be used for migrating databases between SQL Server and Azure. However the tool works just as well as between SQL Server and SQL Server. The trick is to set SQL Server rather than Azure as the target in the advanced options.
The reason this is a better option than the SSMS scripting wizard is that it uses BCP for the data transfer rather than TSQL and so is much more efficient.

SQL Server 2008 Web edition

My company is planning to migrate it's intranet/internet based ERP to the latest form of MS SQL Database available.
Presently we are using SQL Server 2000 Professional.
And we are planning to shift to SQL Server 2008 Web edition.
Please tell me whether this is the right step and whether it is feasible or not.
Thank you in advance.
"Please tell me whether this is the right step " - that's something you and your company need to decide.
It is feasible, and in the majority of cases straight forward.
Your first step should be to run the Microsoft SQL Server 2008 Upgrade Advisor
Microsoft SQL Server 2008 R2 Feature Pack contains the Microsoft SQL Server 2008 R2 Upgrade Advisor
Formulate and test a rollback plan
Determine your upgrade window and acceptable downtime.
Ensure database consistency: Run DBCC CHECKDB on databases to be upgraded to ensure that they are in a consistent state before performing the upgrade.
Back up all important files: Back up all SQL Server databases from the instance to be upgraded (including master, model and msdb), data and transaction log files, as well as any application files, script files, extract files, etc. so that you can completely restore them in the event of a failure.
It's both feasible and easy. The path from one version of SQL Server to another is usually pretty simple. Do you have any special stored procedures or reports generated in SQL Server that need to be rewritten/re-imported?
As far as right step - the question is, Why? If it's working, do you really need to mess with it?
If it's for intranet (some app for your internal usage) then consider using SQL 2008 Express edition. It's free and you can use it as an instance running along the full 2000 version. That way you will have some extra features from the full version.
But you have to know that applications running on SQL 2000 may not work on 2008 and they are even more probable not to work on 2008 R2.

Creating SQL Server 2000 database using SQL Server 2008

My development machine has SQL Server 2008 Developer edition on it. A production server I am going to do some development for has SQL Server 2000 on it. Is there a way to create a 2000 database using my 2008 developer edition? Or do I need to create it on the 2000 server and move it to my development machine?
It will not be possible to move the development database into production. Once a database file has been upgraded to the SQL 2008 format, it is impossible to downgrade to SQL 2000 format.
You should focus your development on creating T-SQL scripts instead of creating database objects. This includes initial database creation and any subsequent schema changes. Perhaps you can use a version based approach for your schema and catalog data. As long as you don't use any SQL 2008 specific functionality, the scripts will run fine on SQL 2000.
Setting the db compatibility level to 80 on development will help making the behavior of the 2008 server closer to the 2000 server, but it does not mean the 2008 specific features will not be usable. You have to pay attention and make sure every functionality and feature you use in development will also be available in SQL 2000.
create a database in 80 compatibility mode and you should be ok with regards to sql you use. but you can't restore a 2008 db on a 2000 server.
I suggest you try it this way:
If your SQL 2008 database, right click, select Tasks, Generate Scripts. Now select your database, select your options in the next window (like script Drop, script Data...), continue through the wizard until Finish.
Now SQL will make your qualified script and it is ready to run.
It depends on how you're going to get the new database back to the production 2000 server; if you create it in your 2008 instance, you can't back it up and restore it to 2000, even if you create it in compatibility 80 as Mladen noted; but you could generate scripts to export your database to the 2000 instance, as long as you don't have to copy any of the data in the tables.
If you need to do a full backup and restore of the new database, you'll be better off with a 2000 instance to connect to for development, MSDE could be installed as a named instance alongside the 2008 edition.
yes, the database can;'t be restored from SQL 2008 even with 80 compatibility on SQl 2000 instance.
If you have to restore , script the DB and objects and recreate them on SQl 2000.
-Ashok

Restore SQL Server 2008 DB *to* SQL Server 2005

Got myself in a bit of a pickle here ... working on a CMS project, under the assumption that sql server 2008 was greenlighted as the db of choice. Well it wasn't, we now have to backport all of our content out SQL Server 2008 and into SQL Server 2005.
A simple backup/restore procedure yields: "RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3241)".
Unfortunately, exporting the data to an excel spreadsheet yields multiple OLE errors which I believe is actually a problem in the db of the cms.
Does anyone out there have other approaches they would like to recommend for this task? Thanks in advance
Use RedGate:
tool for comparing and deploying SQL Server database contents.
You can work with live databases, backups, or SQL scripts in source control. Damaged or missing data can be restored to a single row, without the need for a full database recovery.
SQL Data Compare helps you compare and deploy changes quickly, simply, and with zero errors...
There is no way to do this by default. You can generate scripts for 2008 database on 2008 server and then execute these scripts on 2005 version. Note that you’ll have to manually review scripts and remove all parts that are unique to 2008 version.
Another way is to use third party tools such as Red Gate or ApexSQL Diff (move schema) and ApexSQL Data Diff (move data).
Use the Generate SCripts to create the database and schema and ensure you target SQL Server 2005 and script data.
Rather than do a backup and restore you might try using SQL 2005's Import/Export Data wizard.
http://support.microsoft.com/default.aspx?scid=kb;en-us;314546
http://msdn.microsoft.com/en-us/library/ms140052(SQL.90).aspx
I've just hit the same problem and here is how I worked around it.
The problem was to copy a database from an operational SQL Server 2008 database to a new SQL Server 2005 database.
I scripted the database using Management Studio on the 2008 server. I only scripted the database design, not the data. I should add also that the DB only has tables and indexes, so I haven't tried this with any cleverer objects although I can't think why they wouldn't work.
On the 2005 server I created a new database by hand and then ran the script to set up all the tables and indexes.
The in Management Studio back on the 2008 server I used the Export Data wizard to export the data from the 2008 server to the 2005 server. It's currently running and seems quite happy moving the data.
Once all the data is across I'll have a couple of small things left to do - create the users and set-up the security in the 2005 DB, but all-in-all it doesn't look like a bad way of doing it. It's not quite point-and-click but it's not too strenuous.
So it seems that the Copy Database wizard won't work (I think because the package ultimately runs on the 2005 server and 2005 Management Studio can't talk to 2008) but the Export Data wizard is quite happy moving data ... as long as the DB already exists on the target server.
Hope that's useful.
It's not possible to restore to previous versions in SQL Server
Is there no SQL 2005 backup around? Otherwise you really are limited to export the entire database in 2008, and re-import back into 2005, or the Import/Export wizard in 2008
Or rely on 3rd party tools. e.g. Red Gate Data Compare is able to sync. the DATA between 2 servers/databases
I only use mysql but can you export your data into sql statments, and then import then into sql2005? Just a thought..
I faced a similar problem (sql 2005 to sql 2000), and found that I happened to have a blank database at the older version. I used bcp.exe to copy all the data.
check this link click here
You can create the database script in sql server 2008 and you can use it sql server 2005 and lower version....