How to move database from SQL Server 2012 to SQL 2008
By Kevin Hsu - Updated January 10, 2019
If you need to restore a database backup from a higher version of SQL Server, then you would need to follow these steps in order to restore properly. In this example we will be show how to backup an application in a SQL Server 2012 environment by generating a script, and restoring it into a SQL Server 2008 environment.
1. Navigate to SQL Server Management Studio and right-click on the database you want to back-up.
2. Select “Generate Script”
3. Click Next
4. Click Next
5. Click on Advanced
6. Change the Server Version to SQL Server 2008 and Types of data to script to Schema and data, and click OK
7. Then specify a save location, then click Next
8. Then click Next
9. Once it finishes, click Finish
10. Copy the Script file to the target database environment.
11. Edit the Script file to replace ALL target database file path with your own database environment path
12. Run the following SQL command in a command prompt as ADMINISTRATOR
sqlcmd -S <target server name> -i C:\<your file here>.sql -o <output filename>
Please note, if your target database instance is not the default SQL instance, you need to use the complete ServerName\InstanceName for <target server name>.
13. Once it’s complete, then check SQL Server Management Studio to see if database restored correctly in the target environment.