Migrate SQL Server Database to Lower Version – 3 Ways
The blog will be discussing the step wise procedure on how to migrate SQL Server database to lower version using 3 methods.
Scenario: Suppose a situation in which a user of SQL Server Database upgrades its SQL Server from lower version to higher version and realizes that its application is not functioning properly after the upgrade. Evidently, the user wishes to roll back the upgrade by downgrading the SQL Server Database version to its previous version. However, he/she is unable to attach the database or restore the backup of database even after setting the compatibility level to lower version.
Error Message While Restoring the SQL Server Database
The following error message will be displayed when the user tries to restore or attach the database. It happens as the SQL Server is automatically upgraded to higher version and it does not allow user to restore database from higher to lower version.
Note: The scenerio/problem explained above is one of the many problems faced by our clients. If you generally want to shift to Lower Version of SQL server, you can follow these given solutions.
Move SQL Server Database to Lower Version Using SysTools Software
As you know, handling SQL can be tricky as it involves so many complex procedures. Also, nobody wants to mess up with their data. So it is suggested that you go for a professional software that will turn laborious and wearisome task into unchallenging efforts.
The Above SQL Migrator can transfer or Copy SQL Tables data with schema, Functions, Views, Stored Procedures, Triggers etc. Moreover, if any data gets deleted, the same software can help you restore the database.
Follow the Qick Guide here to migrate SQL Server database to lower version:
Step-1. Start the Software & then Click on the Open button.
Step-2. Select the Online or Offline Mode as per the choice.
Step-3. Preview the Database Objects before moving forward.
Step-4. Adjust the Export Settings as per your preference here.
Step-5. Click the Export button at last & finihs the migration task.
How to Migrate SQL Server Database to Lower Version
The error occurs as SQL Server database files and backups are not backward compatible restricting restore of database created from higher SQL Server version to lower version. Also, below are some of the steps to migrate SQL Server Database from higher version to lower version:
1. Use Generate Scripts wizard of SQL Server Management Studio in Higher version
In this step, we will first script the schema of the desired Database on SQL Server 2012 instance to migrate the database to SQL Server 2008 R2 using Generate Scripts wizard of the SQL Server Management Studio.
- Launch Microsoft SQL Server Management Studio (SSMS) and Go to Object Explorer.
- Select the desired database and right-click on it.
- Click on Tasks and choose ‘Generate Scripts’
- Generate and Publish Scripts wizard will be opened.
- Click on Next & proceed to Choose Objects page
- On the page, choose the option ‘Script entire database and all database objects’ and click on Next to move to next Tab. i.e. ‘Set Scripting Options’
- Define the location to save the script file on the Set Scripting Options Tab
- Click on Advanced button to specify scripting options
- In Advanced scripting options, we will modify some of the options
Script for Server Version →SQL Server 2008 R2
Types of data to script → Schema and Data
Set Script primary key, Triggers, Indexes options True
- Click on OK after making the changes in Advanced Scripting Options and go back to Set Scripting Options Page. Enter ‘Next’ to proceed to Summary Tab
- Click on Next on Summary Page after review the selections made.
- Lastly, click on Finish button to close the Generate and Publish Scripts Wizard. This is crucial after the successful completion of script generation process.
2. Connect to Lower Version, Run SQL Scripts to Create Database Schema & Copy Data
In the second part of the procedure, we will connect to the lower version i.e. SQL Server 2008 R2 Instance and run the scripts generated earlier in the first part to create the database schema and copy all its data.
- We will go to Object Explorer and Connect to the SQL Server 2008.
- Open the script created by going to File in SQL Server Management Studio →Open→File
- Select the script file created and click on open to use the script in SSMS.
- Change the script to define the location of the Database data and log files.
- Execute the script on create the database on SQL Server 2008 instance
- After the scripts have been executed successfully, refresh the database folder in Object Explorer of SSMS.
- Click on the database to check if all the data has been successfully downgraded from SQL Server 2012 to SQL Server 2008 R2.
In the blog, we have discussed about the error when user of SQL Server Database upgrades from lower and higher version. Also experiences that the application is not functioning properly are also there. In such situations, we can use the scripts using Generate Scripts Wizard in higher version and execute the same scripts in lower version. The steps are given for the whole process to migrate SQL Server database to lower version.
It is advisable that users take backup of database before upgrading their SQL Server version. Since the migration process takes lots of time and storage, downgrading SQL Server Database must include professional software to migrate SQL Server from higher to lower version.