So im in the process of syncing data between an old Umbraco 8 site, to a new Umbraco 13 one.
I got all the .config usync files from the v8 site and copied the files over to my v13 site.
However, im syncing up to 5000 media config files, The import fails. Im seeing this in the debug logs:
[22:22:14 WRN] MediaHandler: Import Failed : System.InvalidOperationException: This SqlTransaction has completed; it is no longer usable.
at Umbraco.Extensions.NPocoDatabaseExtensions.GetCurrentTransactionIsolationLevel(IDatabase database)
at Umbraco.Cms.Infrastructure.Scoping.Scope.get_Database()
at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.MediaRepository.MediaByGuidReadRepository.PerformGet(Guid id)
at Umbraco.Cms.Core.Cache.DefaultRepositoryCachePolicy`2.Get(TId id, Func`2 performGet, Func`2 performGetAll)
at Umbraco.Cms.Core.Services.MediaService.GetById(Guid key)
at uSync.Core.Serialization.Serializers.ContentSerializerBase`1.FindItem(XElement node)
at uSync.Core.Serialization.SyncSerializerRoot`1.Deserialize(XElement node, SyncSerializerOptions options)
at uSync.BackOffice.SyncHandlers.SyncHandlerRoot`2.ImportElement(XElement node, String filename, HandlerSettings settings, uSyncImportOptions options)
[22:22:14 WRN] MediaHandler: Import Failed : System.InvalidOperationException: This SqlTransaction has completed; it is no longer usable.
And stuff like this from the logviewer:
Microsoft.Data.SqlClient.SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "FK_cmsContentNu_umbracoContent_nodeId". The conflict occurred in database "ampirocms_prod", table "dbo.umbracoContent", column 'nodeId'.
The statement has been terminated.
at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)
at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at Microsoft.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean isAsync, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String method)
at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)
at NPoco.Database.ExecuteNonQueryHelper(DbCommand cmd)
at NPoco.Database.InsertAsyncImp[T](PocoData pocoData, String tableName, String primaryKeyName, Boolean autoIncrement, T poco, Boolean sync)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
ClientConnectionId:1f469f6e-66fb-4668-af35-20e465ee71f9
Error Number:547,State:0,Class:16
looking in the umbracoContent table I see no rows at all.
Im at my wits end, im in the final stages of upgrading a client site but im getting stuck on this issue over and over again. Im not even sure if the data i have is massive or not, but I know itâs 5000 media usync files and around 3000 content usync files.
Iâve tried the uSync.Exporter package, where I can create my own export packs, but for some reason ( i do not know why ) when exporting nodes im ONLY getting the media files, no content. This also makes me think im not getting all the media files im supposed to get.
So I did a clean export from my prod data, i started the umbraco 8 site locally, whilst connected to prod data and did a simple usync clean export, im confident I have all the data exported.
Now I just need to be able to import it into my v13 site.
I could try and import like 1000 media usync files at a time, but then Im afraid if lets say i have 5 usync files, A,B,C,D and E. and I only sync A-D. Whilst the E file is actually a media-folder that holds A-D. Will that ruin my sync?
Im very grateful for any input or insight into my issue. My client is anxious as this Upgrade from v8 to v13 has taken soooooooo long