Cannot restore umbraco Database from Bacpac.
a
I have this weird issue where i cannot restore a copy of my Production database from a bacpac. It restores just fine from the oldschool
.bak
format. But since i need the database uploaded to Azure this doesn't help me. It fails on the following;
Copy code
ALTER TABLE [dbo].[cmsContentTypeAllowedContentType] WITH NOCHECK
    ADD CONSTRAINT [FK_cmsContentTypeAllowedContentType_cmsContentType] FOREIGN KEY ([Id]) REFERENCES [dbo].[cmsContentType] ([nodeId]);
With the message
Copy code
Msg 1776, Level 16, State 0, Line 1
There are no primary or candidate keys in the referenced table 'dbo.cmsContentType' that match the referencing column list in the foreign key 'FK_cmsContentTypeAllowedContentType_cmsContentType'.
Msg 1750, Level 16, State 1, Line 1
Could not create constraint or index. See previous errors.
But the columns are there just fine... Has anyone experienced this and found a workaround? https://cdn.discordapp.com/attachments/1227508973301792818/1227508973649793024/image.png?ex=6628a9d1&is=661634d1&hm=da11f9eefbf956e09a63eabbd617b90a631bc449aa14bf172f67a9a72d785f44&
s
The FK definition sets the key on
([Id])
but maybe it needs the full
[dbo].[cmsContentTypeAllowedContentType].[Id]
?
The other thing I've often ran into is that I'm using a specific user to log into SQL, which doesn't have the dbo schema and.. weird things happen. I make sure I always log in with
sa
locally to make sure I have all the powerrrr
a
@Sebastiaan might try with the SA user - just weird it doesnt happen to any of my other databases on the machine :S