sql-serverwindows-server-2016bacpac

Why would a .bacpac file take several hours to import?


I'm developing an Umbraco 8 site and I'm in the very early stages, so I have an extremely small database set up on SQL Server 2017 Express.

I've got to the point where I'd like to transfer this to a server so that I can show other people. I've exported a .bacpac file using the "Export Data Tier Application" option in SQL Server Management Studio 2018 and copied this over to the server. The file is 55kb, so I'd expect it to import within seconds. If I do this locally, it does indeed complete quickly.

However, on the server, when I use the "Import Data Tier Application" option, the database restore takes several hours, getting stuck on:

- Importing package schema and data into database
- Updating Database
- Importing Data
- Processing Import

It also seems to get stuck on "Processing Table '[dbo].[umbracoUser]'", although I didn't monitor the whole process, so I'm not sure if that was just one of several slow imports.

The server also runs SQL Server 2017 Express, and I'm importing through SQL Server Management Studio 2017. The server is running Windows Server 2016.

I've noticed this with a couple of databases, and I'm struggling to come up with a reason. I've attempted to use SqlPackage.exe to import this too and that also appears slow.


Solution

  • Turns out that this was an issue with memory usage, when the import happens the memory ramped up to 100%. It does complete after a while but I ended up freeing up resources for the import.