Hi Titus Tolbert (Sr. Dev Operation, Hoka corp),
Welcome to Microsoft Q&A Forum!
Have a good day and I hope you're doing well!
Based on my research and experience with similar SharePoint 2016 to 2019 migrations involving large datasets (500GB+), the behavior you are seeing is, unfortunately, a common bottleneck caused by resource contention, but it is usually solvable without data loss.
The reason Test-SPContentDatabase passes is that it is a read-only operation checking for logical orphans and missing dependencies. However, Mount-SPContentDatabase performs heavy write operations upgrading the schema, transforming features, and re-indexing security scopes.
With a 500GB database, these parallel operations create massive contention on internal system tables. SQL Server detects this cycle and kills one process (the deadlock victim) to save the system, which triggers the SharePoint rollback.
Here are the steps I recommend to resolve this:
1. Force Sequential Execution: Deadlocks often occur because multiple SharePoint servers are trying to access the DB, or the local Timer Service is spinning up too many parallel threads.
- Stop the "SharePoint Timer Service" on all servers in the SharePoint 2019 farm, except for the one server where you are running the PowerShell command.
- Stop Search Services (Search Host Controller, Search Query and Crawl) temporarily.
This isolates the upgrade process to a single node, significantly reducing lock contention.
2. Adjust SQL Server MAXDOP: In some upgrade scenarios, temporarily reducing SQL parallelism has been observed to reduce contention and allow schema upgrades to complete successfully.
- Check the Max Degree of Parallelism (MAXDOP) setting on your SQL Server instance.
- Temporarily set
MAXDOP=1for the duration of the upgrade.
This forces SQL Server to use a single processor core for the query execution plan, effectively eliminating the possibility of parallel threads fighting for the same row locks.
Reference: Server configuration: max degree of parallelism
3. Retry the Operation: The SQL error advises to "Rerun the transaction," which is valid here. Since SharePoint upgrades are incremental, the first run likely completed some schema updates. A second attempt often succeeds simply because there is less work remaining to process.
While 500GB is supported, it is well above the recommended "soft limit" for ease of maintenance. If you still have access to the SP2016 environment, the cleanest path is to split the site collections into smaller Content Databases (<200GB) and attach them individually. This drastically reduces upgrade risk and future backup/restore times.
I hope this information provides you with some valuable insights. If I misunderstood the situation or if anything is unclear, or if you have any further questions or concerns, please feel free to reach out.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.