For the past couple of days, I have been trying to restore the database of my Dev environment. I followed the following steps: -
- Refresh Database of the UAT Environment from LCS with Live environment as source environment.
- Export Database of the UAT Environment.
- Downloaded the bacpac file onto the Virtual Machine.
- Downloaded and extracted the sqlpackage-win-x64-en-170.4.83.3 folder I got from the Microsoft page.
- Opened cmd and set my directory to inside the SQL folder.
Now every time I have tried to run the database restore command, I get this error, here is the complete cmd transcript: -
C:\Users\Admin686d15ff45>cd /d J:\sqlpackage-win-x64-en-170.4.83.3
J:\sqlpackage-win-x64-en-170.4.83.3>SqlPackage.exe /a:Import /sf:J:\cpiuatbackup.bacpac /tsn:LOCALHOST /tdn:AXDB_FinNewCPIUat /p:CommandTimeout=6000 /TargetEncryptConnection:False
Importing to database 'AXDB_FinNewCPIUat' on server 'LOCALHOST'.
Creating deployment plan
Initializing deployment
Verifying deployment plan
Analyzing deployment plan
Importing package schema and data into database
Updating database
*** Error importing database:Could not import package.
Error SQL72014: Core Microsoft SqlClient Data Provider: Msg 2714, Level 16, State 5, Line 1 There is already an object named 'DF__DMFDEFINI__PARTI__73790647' in the database.
Error SQL72045: Script execution error. The executed script:
ALTER TABLE [dbo].[DMFDEFINITIONGROUPENTITY]
ADD CONSTRAINT [DF__DMFDEFINI__PARTI__73790647] DEFAULT ((5637144576.)) FOR [PARTITION];
Error SQL72014: Core Microsoft SqlClient Data Provider: Msg 1750, Level 16, State 1, Line 1 Could not create constraint or index. See previous errors.
Error SQL72045: Script execution error. The executed script:
ALTER TABLE [dbo].[DMFDEFINITIONGROUPENTITY]
ADD CONSTRAINT [DF__DMFDEFINI__PARTI__73790647] DEFAULT ((5637144576.)) FOR [PARTITION];
Time elapsed 0:17:34.62
J:\sqlpackage-win-x64-en-170.4.83.3>
This is what happens each time I try to do it, I have tried redownloading the bacpac file, Refreshing the database of UAT again and getting a new bacpac file, and I tried manually altering the Dev table and dropping the mentioned object, but when I do that, I just get the same error again but with a different object.
Further information, my dev environment is version 10.0.45.
Please Help.

Report
All responses (
Answers (