How to restore SQL Server 2008 database to SQL Server 2005  

How to restore SQL Server 2008 database to SQL Server 2005


The following is a problem when restoring SQL 2008 backup to SQL Server 2005:

"I have been working on a database on my laptop that has SQL Server 2008 Ktma installed.

The database was restored from a full backup taken from the production SQL 2005 Server.

You've completed your job and want to restore the SQL 2005 database from a backup taken on a SQL 2008 server, which was saved as a disk file without compression. You're now looking to restore it back to the production server.

The SQL 2008 backup file is not compatible with SQL Server 2005. SQL Server 2005 only supports backups created with SQL Server 2005 or earlier.

"The media family on device xxxx is incorrectly formed ...."

The fact that you can't restore a backup from a higher version of SQL Server on a lower version of SQL Server. How to do it? Please read on the following, I will discuss it.

How to restore SQL 2008 database to SQL 2005

Step 1. To convert a database to a different version of SQL Server, open SQL Server Management Studio 2008, navigate to the 'Object Explorer', right-click the database you want to convert (StudentDB), and select 'Tasks' > 'Generate Scripts...'.

Step 2. Click 'Next'.

Step 3. Select the database (StudentDB) that you want to convert, and check on 'Scripts all objects in the selected databases'

Step 4. Set options:

'Script for Server Version' = 'SQL Server 2005'

'Script Data' = 'True'

'Script Database Create' = 'True'

Step 5. Select the option 'Script to file', 'Single file' and 'Unicode text' on Output Option Window.

Step 6. View summary and click 'Finish'.

Step 7. A complete database creation script with data is available, which can be executed on a SQL Server 2005 database server. This script allows for the creation of a database on the target server.

Step 8. Open the generated script in SQL Server Management Studio 2005. Find the following section and change the path to proper data folder

CREATE DATABASE [StudentDB] ON PRIMARY

( NAME = N'StudentDB',

FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\StudentDB.mdf,

SIZE = 5662KB, MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )

LOG ON

( NAME = N'StudentDB_log',

FILENAME = N'c:\Program Files\Microsoft SQL

Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\StudentDB_log.LDF',

SIZE = 7032KB, MAXSIZE = 1024GB, FILEGROWTH = 10%)

Step 9. Execute the Script. When finished, You should get converted database of SQL Server 2005

SQL backup & disaster recovery software

Qiling Backup Server is a software that backs up and restores data for Microsoft SQL Server and Exchange databases. It supports various versions of SQL Server and Exchange.

Main features:

To backup and restore SQL Server database, follow these steps: First, open SQL Server Management Studio and connect to the server that hosts the database you want to backup. Then, in the Object Explorer, right-click on the database and select Tasks > Backup.

To protect your database for business security, learn more about SQL backup and recovery solutions by referring to Qiling Backup, a reliable SQL backup and recovery software.

Related Articles


Is this information helpful?     

What can we do to improve this information? (Optional)
Refresh Please enter the verification code!


QilingTech uses cookies to ensure you get the best experience on our website.  Learn more  Got it