back up DB to an older version - sql-server

I have two SQL Servers of different versions: 2014 and 2012. I cannot upgrade the oldest to the newest one. Can I back up a DB on 2014 so that I can restore it on 2012? I would like to restore both schema and data. I would also prefer to do it through backing up, not through scripting out. Right now I am getting an error saying something like "the versions are incompatible, and you cannot restore the DB". I appreciate your help.

You can't back up & restore the database from a higher (2014) to lower (2012) version.
You can generate a script from SQL Server 2014 (DB creation and data creation script) and you can run on SQL server 2012. Only scripting is an option in this scenario to create a database/restore a database from SQL server 2014 to 2012.
You can certainly take a back from SQL server 2012 and restore in the SQL server 2014.

Related

Restore database in SQL Server from .bkp file [duplicate]

The database was backed up on a server running version 8.00.2039. That version is incompatible with this server, which is running version 11.00.2100. Either restore the database on a server that supports the backup, or use a backup that is compatible with this server. (Microsoft.SqlServer.SmoExtended)
I am trying to restore and I get this message.. is there anyway to restore this backup without having to install SQL Server 2005?
SQL Server 2012 (v11.0) doesn't support direct upgrade from SQL Server 2000 (v8.0).
You'll have to use a "in-between" step restoring your SQL Server 2000 database to a SQL Server 2005 or 2008 instance, and then do a backup from there, in order to get your .bak file into the latest database server.
There's no trick or workaround for this - that's just the way it is, and you'll have to deal with it.
There are tons of blog posts on this topic, e.g.
Migration SQL Server 2000 to SQL Server 2012

Can we restore database to SQL Server 2017 taken from SQL Server 2012?

Can we restore a database which is created and have some data in SQL Server 2012. But, now i want to migrate from SQL Server 2012 to SQL Server 2017. Is it possible to take backup in SQL Server 2012 and restore it to SQL Server 2017. I need some other solutions if not possible to restore it. Because, it's almost 30GB of data, i can't get it back if not possible to restore.
Yes, SQL Server is backward compatible. You can restore a database from any previous version of SQL Server that was supported at the time of the release. For SQL Server 2017, you can therefore restore databases from SQL Server 2008 to 2017.
SQL Server, however, is not forward compatible. Once a database is restored on a more recent version of SQL Server you cannot create a back up of that database and restore it to an older version; even if the database had the correct compatibility setting. The upgrade process is one way.
"Once a database is restored on a more recent version of SQL Server you cannot create a back up of that database and restore it to an older version", But as a work around you can script database and execute it in an older version.

SQL Server 2014: Restore old backup

I'm trying to restore an old database backup in SQL Server 2014, and I'm getting the error below:
How can I go through this?
I'm importing the backup in the follow way:
Tasks -> Restore -> Database
Select device option -> Pick up the .bak file
At the options select Overwrite
ok
Thanks in advance.
You are trying to restore a SQL Server 2000 database on SQL Server 2014. This is not supported.
You will need to restore your database on an instance of SQL Server 2005, 2008 or 2008 R2 first, then back it up from there, then restore the new backup on SQL Server 2014. Microsoft explains this here how to on SQL Server 2012.
I don't think you'll be able to jump that many versions from a SQL 2000 backup straight to 2014. It's just too much of a jump with too many changes to be made.
Restore it to SQL 2008 first, then back this up and then restore to 2014.
Here's some links to guides that should be able to help you;
http://sqlmag.com/sql-server-2014/sql-select-steps-migrate-sql-server-2000-sql-server-2014
https://blogs.technet.microsoft.com/mdegre/2012/06/15/migration-sql-server-2000-to-sql-server-2012/
First of all not, that you can restore your SQL Server database backups on a different version of SQL Server, but with one tiny restriction. You can restore your backups only upwards, it means that you can restore from SQL Serve 2005 to 2008 or from 2012 to 2014.
But it has to be admitted, there is no way of restoring your database backups from SQL Server 2012 to 2008. SQL Server has such restriction because every new version has modifications in the binary of the database and their storage.
Also, you can't jump forward two versions, for example, you cannot restore a database backups from SQL Server 2000 to SQL Server version 2014 as you are trying.
As it has recommended above you need to restore in few steps. Firstly restore it on SQL Server 2005 or 2008. make a full backup and then restore it on SQL Server 2014.

How to migrate from SQL Server 2005 to SQL Server 2012

I have this scenario:
Old Server -> SQL Server 2005 with the current Database
New Server -> SQL Server 2012 no database created.
I want to migrate the old database to the new one.
I've tried to create a backup from the Management Studio 2005 and restore in the 2012. Failed.
I've connected from the 2012 server using Management Studio 2012 to the old server and create the backup. Then restored in the new one. Failed.
The error said that the versions are incompatibles (tried to restored a version from 8.0 to 11.0)
Then, I tried to use the Copy database Wizard. But a error message shows up:
The destination server can not be an instance of SQL Server 2005 Express or higher .
So, how it is supposed to do the backup?
I'm getting the scripts in sql files as last resort...
PS: I've check this thread, I need to migrate to 2008 and then 2012?
How to migrate a database from SQL Server 2005 to 2008 as is?
When I have performed a SQL Server migration in the past I have normally performed a SQL Backup, copy to the new server and then restore, I see in your question that you got an error, update the question with the error and perhaps we can be more specific about what you need to do to make it succeed.
I have also performed a migration by detaching the database from the old server, copying the data and log files to the new server and attaching the databases. This is the method I tend to go with.
The SQL you would use to attach the MDF/LDF files is as follows:
CREATE DATABASE MyAdventureWorks
ON (FILENAME = 'C:\MySQLServer\AdventureWorks_Data.mdf'),
(FILENAME = 'C:\MySQLServer\AdventureWorks_Log.ldf')
FOR ATTACH;
You can refer to the documentation at: https://msdn.microsoft.com/en-AU/library/ms190209(v=sql.110).aspx
Please apply latest service pack SP4 on 2005 databases after this take a full backup of 2005 databases and restore it on 2012. I hope, it will work.

Moving database from SQL Server 2008 to SQL Server 2005

I want to move my my database of a SQL Server 2008 to a SQL Server 2005 Express on another machine. Is this possible? How should I do this?
There is no "built-in" way to move a database from a newer SQL Server version to an older version.
The only way that I know if is to use SQL Server 2008's "Generate Script" wizard to script your whole database (tables and data) and execute these scripts on the SQL Server 2005 to insert the data there.
(Moving a database from a older SQL Server version to an newer version would be easier - just take a backup and restore, SQL Server automatically converts it to the new version)

Resources