When I try to restore a backup from sqlserver 2008 R2 to sqlserver 2008, I have the following error:
There's a way to make a compatible backup ?
You can't because the structure is incompatible (can't go backwards).
Look at solutions like SSIS transfer between two connected servers, or if the database is small, script out the create db objects + insert data statements and execute on the other.
Or purchase some tool e.g. from Redgate for this task.
If you don't use R2 Futures in data base... You can generate script database (schema and data) in sql server 2008 R2.
Then create a database none any object. And run script for this data base in sql server 2008.
You find how to generate script database with data Click here
Related
I'm looking for a way to create a command line script to backup SQL Server 2016 which can be restored in a older version SQL Server 2012.
We have a daily backup from our SQL Server 2016 using the
BACKUP DATABASE XXXX TO DISK = "C:\BACKUP.BAK"
and this back up is provided to a 3rd party which is running an older SQL Server 2012.
When they use SMSS they get an error stating an error about the incompatible version.
I've tried using ALTER DATBASE XXXX SET COMPATIBILITY_LEVEL = 110 ( targeting even a lower than SQL Server 2012 version)... thinking it can be loaded in their 2012 but when they try to load it, it still states that the backup file is in 2016 (v13.xxx) ?!
Sample backup script
USE MYDB;
ALTER DATABASE MYDB SET SINGLE_USER
GO
-- TARGETING SQL Server SQL Server 2012
ALTER DATABASE MYDB SET COMPATIBILITY_LEVEL = 110
GO
BACKUP DATABASE MYDB
TO DISK = 'C:\TEMP\MYDB.BAK'
ALTER DATABASE MYDB SET MULTI_USER
GO
Can anyone let me know what Im doing wrong?
Thanks
You just simply 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. And the "database compatibility level" also doesn't help.
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.
I recently did a Oracle to SQL Server 2008 R2 Migration. The PL/SQL stored procedures were converted to T/SQL by SSMA. The converted T/SQL has many references to the sysdb database, for instance sysdb.ssma_oracle.db_check_init_package
I then exported the SQL Server 2008 R2 database, and imported it to SQL Server 2012. However I forgot to copy the sysdb database. What is the easiest way of creating the sysdb database?
Thank you!
Just install SSMA for Oracle 5.2 Extension Pack.exe (downloadable from Microsoft) on the computer with the SQL Server database (tell it to ignore the fact that Oracle is not installed on the computer) and it will create the sysdb database for you, and also the Extended Stored Procedures that it needs.
The question is probably extremely easy to resolve, but I need to resolve it because I need to carry on with my project. I am using SQL Server Express 2008 at home, and I've been working on an ASP.NET MVC app that stores my DB in an mdf file in the project's folder. The problem is that the SQL Server in the Uni labs is SQL Server 2005, and when I try to open the mdf file with the VS Server Explorer,It says that the version of the mdf file is more than the server can accept.
The only option that comes to my mind is exporting the DB as an sql file, just like I've done it thousand times with phpmyadmin. the thing is that the SQL Management Studio Express is not the most usable tool in the world, and for some strange reason all the articles I could find in Google were irrelevant. Please, help.
It is not possible to attach database created on SQL Server 2008 to SQL Server 2005. The other direction is possible.
Your only option is to script the database and data and run the scripts on SQL 2005. If you have used any of new features of the SQL Server 2008, you will have to rewrite the scripts.
I haven't used it much, but right click on database -> Tasks... -> Generate Scripts... / Export Data... / Import Data... should do the job right.
Google "Database Publishing Wizard", it's a tool from Microsoft to script an entire database, both schema and data.
you can script your db and its data. then run it on the target server to create a new db that is compatible with 2005 version.
Tools like Red-Gate SQL Compare and SQL Data Compare can compare a live database to e.g. a backup file, so you could compare your SQL Server 2005 database against the SQL Server 2008 Express backup file, and move data that way.
Or you could possibly generate INSERT statements for your tables that have changed data using a tool like this one here or this one here. These can generate INSERT scripts for your tables, which you can take along and run on your SQL Server 2005 target system.
I have a sql server 2008 db, I want to restore its backup to a 2005 version. Is there any way for this work?
Note: I can't make a script from my db and run it.
No. It is not possible to restore a database from a backup of a newer version.
The only solution I have come accross is generating a script, but it seems that you do not want to use this
Unfortunately, SQL Server has never supported this - and still doesn't :-(
There is no way you can create a backup in a newer version and restore it in a previous version - and this goes from SQL Server 4.2 all the way through 2008 R2.
All you can do is either create scripts and run them on the target server, or use tools like SQL Compare and SQL Data Compare to compare the two databases and update the target database from the source (basically, what these tools do is create and execute the necessary scripts in the background, so you won't have to fiddle and create those scripts yourself)
how can we get the restore in sql server 2000 of sql server 2005 data
You can't restore data from sql 2005 to 2000 only if you generate scripts with sql server 2000 compatibility. If you want create and restore backup can't do.
I recently found myself in a similar position on a client site. I came across an article on the MSDN SQL Server Forum (second response from top) with a detailed walk-through on this issue.
I ran into a few issues with scripting users & had to hack my way through it a little bit, but it was a great starting point for me.
I do not think this is possible. You can't go from 2005 to 2000, what you would have to do is install SQL 2005 Express then restore to that and you should be able to manage the backup from there.
If you only need the database structure you can generate scripts for the entire database.
Try this:
In the Properties window of the SQL 2005 Database you can set the compatibility level of that database to SQL 2000. Then perform the backup and then restore to SQL 2000.
If you don't want change the compatibilty level of your original database, just do a backup first and restore the database as a dummy in SQL 2005 and set that database's compatibility level.
alt text http://img411.imageshack.us/img411/8541/clipboard01lro.jpg
Use RedGate SQL Compare and RedGate SQL Data Compare to push the tables and data from SQL 2005 to SQL 2000.
You may be able to script the whole database from SQL 2000 compatibility mode, but getting the data requires something besides a backup and a restore. You could try bulk saving and bulk loading data, too...