Hello,
I am currently experiencing several problems when migrating a database from CouchBaseLite Community 1.3 to CouchBaseLite Enterprise 2.8.6.
This database is encrypted in CouchBaseLite 1.3, following the instructions in the CouchBase documentation we must decrypt this DB before being able to open it with a project under CouchBaseLite 2.8.6.
The goal is :
- Opening of the DB with a project under CouchBaseLite 1.4.4
- DB decryption
- Opening of the DB with a project under CouchBaseLite 2.8.6
oAutomatic migration - DB encryption with CouchBaseLite Enterprise 2.8.6
The first problem encountered is the decryption of the DB in 1.4.4 using the ChangeEncryptionKey(Null) method.
We are using a client’s DB which is 7,7Go and which contains 20Go of attachments.
- Opening of the DB : OK
- DB decryption : NOK
o If I use a compact method before decryption it doesn’t work either (After the compact the DB is 900Mo and the attachments folder 16Go)
Here is the error I get while decrypting, with or without compact :
System.ObjectDisposedException
HResult=0x80131622
Message=La collection a été supprimée.
Nom de l’objet : ‘BlockingCollection’.
Source=System
StackTrace:
at System.Collections.Concurrent.BlockingCollection1.CheckDisposed() at System.Collections.Concurrent.BlockingCollection
1.TryAddWithNoTimeValidation(T item, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Couchbase.Lite.Storage.ConnectionPool.Release()
at Couchbase.Lite.Cursor.Dispose()
at Couchbase.Lite.Storage.SQLCipher.SqliteCouchStore.TryQuery(Func`2 action, String sqlQuery, Object args)
at Couchbase.Lite.Storage.SQLCipher.SqliteCouchStore.NextDocumentExpiry()
at Couchbase.Lite.Database.SchedulePurgeExpired(TimeSpan delay)
at Couchbase.Lite.Database.PurgeExpired(Object state)
at System.Threading.TimerQueueTimer.CallCallbackInContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.TimerQueueTimer.CallCallback()
at System.Threading.TimerQueueTimer.Fire()
at System.Threading.TimerQueue.FireNextTimers()
at System.Threading.TimerQueue.AppDomainTimerCallback(Int32 id)
This exception was originally thrown at this call stack:
[External Code]
Do you have an idea or an explanation of the problem ?
The second problem is related to the migration of the DB into 2.8.6 version.
In order to do this test, I bypassed my first problem by opening, browsing and copying the encrypted DB into a second DB (still in v1.4.4) which is not encrypted. Then I opened this DB with a project with CouchBaseLite Enterprise 2.8.6.
I encountered this error :
CouchbaseLiteException (POSIXDomain / 13): Permission denied.
at LiteCore.Interop.NativeHandler.ThrowOrHandle()
at LiteCore.Interop.NativeHandler.Execute(C4TryLogicDelegate2 block)
at Couchbase.Lite.Database.<>c__DisplayClass105_0.b__0()
at Couchbase.Lite.Support.ThreadSafety.DoLocked(Action a)
at Couchbase.Lite.Database.Open()
at Couchbase.Lite.Database…ctor(String name, DatabaseConfiguration configuration)
at POC_CouchBase2.X.MainWindow…ctor() in C:\source\repos\POC-CouchBase2.X\POC-CouchBase2.X\MainWindow.xaml.cs:line 23
Do you have an idea or an explanation of the problem ?
In addition, in the json of the stored data we have complex objects in its version 1.3 which must then be migrated automatically when opening the DB with a version 2.8.6. Can these complex objects generate any problem or something else during this migration ?
Here is an example of stored json :
Json stored example
{
“_attachments”:{
“G5500-Product Over View.xlsx”:{
“content_type”:"",
“digest”:“sha1-FkntNE889icKD8M1hf2hURz3jJg=”,
“length”:64417,
“revpos”:19,
“stub”:true
}
},
“collection”:“Document”,
“creat date”:“2019-11-05T09:13:43.8969188Z”,
“entityType”:“Document”,
“members”:{
“Attributes”:[
{
“OId”:null,
“Name”:“Description”,
“Value”:“Overview Excel File”
},
{
“OId”:null,
“Name”:“Title”,
“Value”:“XXX”
},
{
“OId”:null,
“Name”:“XXX”,
“Value”:“YES”
},
{
“OId”:null,
“Name”:“XXX”,
“Value”:“XXX”
},
{
“OId”:null,
“Name”:“XXX”,
“Value”:“NO”
},
{
“OId”:null,
“Name”:“XXX”,
“Value”:“NO”
},
{
“OId”:null,
“Name”:" XXX “,
“Value”:“NONE”
},
{
“OId”:null,
“Name”:” XXX “,
“Value”:“NO”
},
{
“OId”:null,
“Name”:” XXX “,
“Value”:“Corporate”
},
{
“OId”:null,
“Name”:” XXX “,
“Value”:” XXX "
},
{
“OId”:null,
“Name”:" XXX “,
“Value”:“Overview”
},
{
“OId”:null,
“Name”:” XXX “,
“Value”:“Commercial Documentation”
},
{
“OId”:null,
“Name”:” XXX “,
“Value”:“WW”
}
],
“Author”:“L3”,
“BSL_LastModificationDate”:“2020-04-14T11:39:00.522+02:00”,
“BSLId”:16174393202,
“Certified”:true,
“Confidential”:true,
“CorporateDoc”:null,
“Deleted”:false,
“DocumentDate”:“2019-10-15T02:00:00+02:00”,
“Files”:[
{
“OId”:“21347537153”,
“Extension”:”.xlsx",
“FileName”:" XXX “,
“Size”:64417,
“Status”:1,
“RetryCount”:0
}
],
“FirmwareOriginalVersion”:null,
“FirstSyncStartDate”:“0001-01-01T00:00:00”,
“Id”:” XXX “,
“IsBaseOnId”:null,
“IsMasterDocument”:true,
“IsOtherSource”:false,
“IsRead”:false,
“IsRevisionOf”:null,
“IsSearchVisible”:true,
“Keywords”:”",
“LastSyncDate”:“2020-04-14T16:19:58.300327Z”,
“LinkedDocumentsIds”:[
],
"LinkedRangesIds":[
"S2"
],
"LinkedSparePartsIds":[
],
"LocalizedDocs":[
],
"Locals":[
{
"OId":null,
"IsoLanguage":"en",
"IsoCountry":"GB",
"Title":" XXX ",
"Description":"Overview Excel File"
}
],
"OtherLanguagesIds":[
],
"OtherVersionsIds":[
],
"PartNumber":null,
"PublicationDate":"2019-10-15T02:00:00+02:00",
"Reference":" XXX ",
"RetryCount":0,
"Revision":0,
"RevisionString":null,
"SKMSubType":"Overview",
"SKMType":3,
"SKMTypeCode":"Commercial Documentation",
"SubProducts":[
" XXX ",
" XXX ",
" XXX ",
" XXX "
],
"SyncStatus":1,
"SystemCreationDate":"0001-01-01T00:00:00",
"SystemLastUpdateDate":"0001-01-01T00:00:00",
"Version":"1.0"
},
“update date”:“2021-05-10T08:54:25.3882432Z”
}
Thank you in advance for your feedback