Hi @Chamali Liyanage ,
> Is it possible to restore the 2019 DB backup to 2012 DB with the same name?
No, we can’t restore a SQL Server backup to a lower version.
I test this on my environment.
DB2012----compatibility level 110(2012). I got the below error when I back the database on SQL 2019 and restore it on SQL 2012.
SQL2012DB--- compatibility level 150(2019). I got the below error when I back the database on SQL 2019 and restore it on SQL 2012.
I suggest you using below methods to migrate database to lower version.
- Using SSMS Generate Scripts Wizard.
In the Advanced Scripting Options dialog box,
•set Script for Server Version to SQL Server 2012 (or whatever version you want)
•under the Table/View Options, set Script Triggers, Script Indexes and Script Primary Keys to True
•and set Types of data to script to Schema and Data - this last option is key because this is what generates the data per table.
Then run the generated scripts on SQL 2012 instance.
Refer to this blog to get more.
For large databases, around 1GB or more, if this approach does not work, then you should look at using SSIS to migrate the database.
2... You can use functionality called Export Data-Tier Application which generates .bacpac file consisting database schema and data.
On destination server, you can use Import Data-Tier Application option which creates and populates new database from pre-created .bacpac file.
Refer to MS document Using the Export Data-tier Application Wizard.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.