?
Oh I see, you're migrating a legacy NuGet feed! Sorry I misunderstood.
With the number of packages you have, a database transaction will put a strain on your database server, which is most certainly where the problem is.
Instead, why not back up the database beforehand, then run the migration without verbose logging and a transaction.