I am trying to open a bacpac file to restore an Azure database but have run into several issues thus far.
I first tried to use SSMS to open the file but ran into the following errors:
===================================
Could not load package from 'C:UserscabbyDownloadsbackup_MSREclipseSQL.bacpac'. (Microsoft.SqlServer.Dac)
------------------------------
Program Location:
at Microsoft.SqlServer.Dac.BacPackage.Load(String fileName, DacSchemaModelStorageType modelStorageType)
at Microsoft.SqlServer.Management.Dac.DacWizard.ImportDatabase.DoWork()
at Microsoft.SqlServer.Management.TaskForms.SimpleWorkItem.Run()
===================================
File contains corrupted data. (Microsoft.Data.Tools.Schema.Sql)
------------------------------
Program Location:
at Microsoft.Data.Tools.Schema.Sql.Build.SqlPackage.Artifact.InitializefromFile(FileInfo fileInfo, FileMode mode, FileAccess access)
at Microsoft.Data.Tools.Schema.Sql.Build.SqlPackage.Open(FileInfo fileInfo, FileAccess access)
at Microsoft.Data.Tools.Schema.Sql.Build.SqlPackage.Open(String file, FileAccess access)
at Microsoft.SqlServer.Dac.FilePackageSource.Microsoft.SqlServer.Dac.IPackageSource.OpenSqlPackage()
at Microsoft.SqlServer.Dac.DacPackage.ContainsExportedData(IPackageSource packageSource)
at Microsoft.SqlServer.Dac.BacPackage..ctor(IPackageSource packageSource)
at Microsoft.SqlServer.Dac.BacPackage.Load(String fileName, DacSchemaModelStorageType modelStorageType)
===================================
File contains corrupted data. (WindowsBase)
------------------------------
Program Location:
at MS.Internal.IO.Zip.ZipIOEndOfCentralDirectoryBlock.FindPosition(Stream archiveStream)
at MS.Internal.IO.Zip.ZipIOEndOfCentralDirectoryBlock.SeekableLoad(ZipIOBlockManager blockManager)
at MS.Internal.IO.Zip.ZipArchive..ctor(Stream archiveStream, FileMode mode, FileAccess access, Boolean streaming, Boolean ownStream)
at MS.Internal.IO.Zip.ZipArchive.OpenOnFile(String path, FileMode mode, FileAccess access, FileShare share, Boolean streaming)
at System.IO.Packaging.ZipPackage..ctor(String path, FileMode mode, FileAccess access, FileShare share, Boolean streaming)
at System.IO.Packaging.Package.Open(String path, FileMode packageMode, FileAccess packageAccess, FileShare packageShare, Boolean streaming)
at Microsoft.Data.Tools.Schema.Sql.Build.SqlPackage.Artifact.InitializefromFile(FileInfo fileInfo, FileMode mode, FileAccess access)
I then tried to use SqlPackage.exe to import the file via command prompt, but got this error:
End of Central Directory record could not be found.
Additionally, I found some links online that suggest converting the bacpac file to a zip file then editing the xml to potentially fix errors, but I am unable to open or extract the zip file after changing the extension from bacpac.
Does anyone have any ideas on what I can try to hopefully restore this data?