DEV Community

Cover image for How to fix a partition issue in a bacpac backup
Antoine
Antoine

Posted on

How to fix a partition issue in a bacpac backup

Photo by Emmanuel Ikwuegbu on Unsplash

In order to fix it, we need to perform 6 steps:

  • rename the .bacpac file to .zip extension
  • extract model.xml and origin.xml
  • open model.xml and change the entry
                <Entry>
                    <Element Type="SqlPartitionValue">
                        <Property Name="ExpressionScript">
                            <Value><![CDATA[NULL]]></Value>
                        </Property>
                    </Element>
                </Entry>
Enter fullscreen mode Exit fullscreen mode

to

                <Entry>
                    <Element Type="SqlPartitionValue">
                        <Property Name="ExpressionScript">
                            <Value><![CDATA[CAST(NULL AS DATETIME2)]]></Value>
                        </Property>
                    </Element>
                </Entry>
Enter fullscreen mode Exit fullscreen mode
  • Save, and compute the new checksum using Powershell cmdlet Get-FileHash:
Get-FileHash -Algorithm 256 model.xml
Enter fullscreen mode Exit fullscreen mode
  • write the checksum in origin.xml to replace previous model.xml checksum
  • Put back files model.xml and origin.xml in zip

Hope it helps !

Oldest comments (0)