Solved

Restore sql server express 2008 backup to sql server 2005 fails

Posted on 2011-03-09
6
503 Views
Last Modified: 2012-05-11
Hi,

I have a local installation of sql server express 2008. On the production machine it's a sql server 2005 installed. I have for long times just created a local database for development and then backed it up and restored it on the production server and everything has worked fine.

Now I have a new development machine and when I now try to do the same I get this error.
"The media family on device 'c\...' is incorrectly formed. SQL Server cannot process this media family."

I then tried to import and export the database and data and that went ok, but when I do so the foreign and primary keys are lost and it's a big database so that would take a long time to go through.

I then tried to first create scripts for the database tables and run them to get the right schema for all tables. Then I imported, but then I got an error that some tables have foreign keys and then you cannot import to these tables.

Does someone have a solution to this dilemma I would be very grateful.

Peter
0
Comment
Question by:peternordberg
  • 3
  • 2
6 Comments
 
LVL 9

Expert Comment

by:mayank_joshi
ID: 35092755
a backup created in MS  SQL 2008 cannnot be restore in MS SQL 2005
0
 
LVL 9

Expert Comment

by:mayank_joshi
ID: 35092763
0
 
LVL 14

Expert Comment

by:Daniel_PL
ID: 35092805
You can try to first generate script for create database in SSMS.
Next you can generate scripts for objects in that database right click on your db, pick tasks, pick generate scripts... Choose your database, on next screen please turn to true all objects you want to script, e.g.:
script triggers, indexes, primary keys, foreign keys, check constrainsts etc. etc.
You can use wizard to copy data between databases.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 9

Expert Comment

by:mayank_joshi
ID: 35092896
If restoring to earlier version of SQL Server problem is not there
then you can try taking the backup once again to a new media set:-

BACKUP DATABASE [DBName] TO  DISK = 'E:\DBName.bak' WITH FORMAT, INIT,  MEDIANAME = 'NewMediaSetName',  NAME = 'DBName-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO

Open in new window


0
 

Author Comment

by:peternordberg
ID: 35093026
Hi and thanks for your answers,

I've tried both your solutions without success. Daniel, I get this error when trying your approach:
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '100'.
Msg 911, Level 16, State 1, Line 3
Could not locate entry in sysdatabases for database 'MirakelOrg'. No entry found with that name. Make sure that the name is entered correctly.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'MirakelOrg', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1

mayank_joshi:
I get the same error on restoring the database when I try the aprocha you gave me.

Thnaks for help!

Peter

0
 
LVL 14

Accepted Solution

by:
Daniel_PL earned 500 total points
ID: 35093203
You can follow instructions from this article:
http://www.devx.com/dbzone/Article/40531
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
This video discusses moving either the default database or any database to a new volume.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now