Sonarr: Restore Windows backup in Linux

Created on 13 May 2018  路  1Comment  路  Source: Sonarr/Sonarr

I know it is not supported but I only found out after I moved. I don't mind to configure Sonarr again but I don't know which shows I monitored and that's a huge pain.

I followed the restore process anyway and it seamed to work fairly O.K., it only could not find any show since the paths are wrong. I tried to fix the paths but the PUT request to the server returns the following error:

{
  "message": "value [Z:\\Serien\\]  is not a valid *nix path. paths must start with /\nParameter name: path",
  "description": "System.ArgumentException: value [Z:\\Serien\\]  is not a valid *nix path. paths must start with /\nParameter name: path\n  at NzbDrone.Common.EnsureThat.EnsureStringExtensions.IsValidPath (NzbDrone.Common.EnsureThat.Param`1[T] param) [0x00050] in M:\\BuildAgent\\work\\b69c1fe19bfc2c38\\src\\NzbDrone.Common\\EnsureThat\\EnsureStringExtensions.cs:109 \n  at NzbDrone.Common.Extensions.PathExtensions.CleanFilePath (System.String path) [0x00048] in M:\\BuildAgent\\work\\b69c1fe19bfc2c38\\src\\NzbDrone.Common\\Extensions\\PathExtensions.cs:30 \n  at NzbDrone.Common.Extensions.PathExtensions.PathEquals (System.String firstPath, System.String secondPath, System.Nullable`1[T] comparison) [0x00027] in M:\\BuildAgent\\work\\b69c1fe19bfc2c38\\src\\NzbDrone.Common\\Extensions\\PathExtensions.cs:55 \n  at NzbDrone.Core.Validation.Paths.RootFolderValidator+<>c__DisplayClass2_0.<IsValid>b__0 (NzbDrone.Core.RootFolders.RootFolder r) [0x00000] in M:\\BuildAgent\\work\\b69c1fe19bfc2c38\\src\\NzbDrone.Core\\Validation\\Paths\\RootFolderValidator.cs:21 \n  at System.Collections.Generic.List`1[T].FindIndex (System.Int32 startIndex, System.Int32 count, System.Predicate`1[T] match) [0x0003b] in <71d8ad678db34313b7f718a414dfcb25>:0 \n  at System.Collections.Generic.List`1[T].FindIndex (System.Predicate`1[T] match) [0x00000] in <71d8ad678db34313b7f718a414dfcb25>:0 \n  at System.Collections.Generic.List`1[T].Exists (System.Predicate`1[T] match) [0x00000] in <71d8ad678db34313b7f718a414dfcb25>:0 \n  at NzbDrone.Core.Validation.Paths.RootFolderValidator.IsValid (FluentValidation.Validators.PropertyValidatorContext context) [0x0001c] in M:\\BuildAgent\\work\\b69c1fe19bfc2c38\\src\\NzbDrone.Core\\Validation\\Paths\\RootFolderValidator.cs:21 \n  at FluentValidation.Validators.PropertyValidator.Validate (FluentValidation.Validators.PropertyValidatorContext context) [0x00029] in C:\\projects\\FluentValidation\\src\\FluentValidation\\Validators\\PropertyValidator.cs:79 \n  at FluentValidation.Validators.DelegatingValidator.Validate (FluentValidation.Validators.PropertyValidatorContext context) [0x00013] in C:\\projects\\FluentValidation\\src\\FluentValidation\\Validators\\DelegatingValidator.cs:62 \n  at FluentValidation.Internal.PropertyRule.InvokePropertyValidator (FluentValidation.ValidationContext context, FluentValidation.Validators.IPropertyValidator validator, System.String propertyName) [0x00009] in C:\\projects\\FluentValidation\\src\\FluentValidation\\Internal\\PropertyRule.cs:368 \n  at FluentValidation.Internal.PropertyRule+<Validate>d__60.MoveNext () [0x000e6] in C:\\projects\\FluentValidation\\src\\FluentValidation\\Internal\\PropertyRule.cs:242 \n  at System.Collections.Generic.List`1[T].InsertRange (System.Int32 index, System.Collections.Generic.IEnumerable`1[T] collection) [0x000ea] in <71d8ad678db34313b7f718a414dfcb25>:0 \n  at System.Collections.Generic.List`1[T].AddRange (System.Collections.Generic.IEnumerable`1[T] collection) [0x00000] in <71d8ad678db34313b7f718a414dfcb25>:0 \n  at System.Linq.Enumerable+SelectManySingleSelectorIterator`2[TSource,TResult].ToList () [0x00028] in <c0502b9f220448589f6c0bfcd98a6c9b>:0 \n  at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0001f] in <c0502b9f220448589f6c0bfcd98a6c9b>:0 \n  at FluentValidation.AbstractValidator`1[T].Validate (FluentValidation.ValidationContext`1[T] context) [0x0001d] in C:\\projects\\FluentValidation\\src\\FluentValidation\\AbstractValidator.cs:114 \n  at FluentValidation.AbstractValidator`1[T].Validate (T instance) [0x00000] in C:\\projects\\FluentValidation\\src\\FluentValidation\\AbstractValidator.cs:95 \n  at NzbDrone.Api.REST.RestModule`1[TResource].ReadResourceFromRequest (System.Boolean skipValidate) [0x00024] in M:\\BuildAgent\\work\\b69c1fe19bfc2c38\\src\\NzbDrone.Api\\REST\\RestModule.cs:195 \n  at NzbDrone.Api.REST.RestModule`1[TResource].<set_UpdateResource>b__44_1 (System.Object options) [0x00000] in M:\\BuildAgent\\work\\b69c1fe19bfc2c38\\src\\NzbDrone.Api\\REST\\RestModule.cs:177 \n  at (wrapper dynamic-method) System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,System.Func`2<object, object>,object)\n  at Nancy.Routing.Route+<>c__DisplayClass4.<Wrap>b__3 (System.Object parameters, System.Threading.CancellationToken context) [0x00049] in <63c44d6f8d7e4f339a987bf9eb94d931>:0 "
}

It looks like the internal folder check is permitting me from fixing the file structure since it can't handle the broken one. Could you fix this or tell me how I can fix the show information manually in the database?

I guess a simple find/replace would do the trick:

Old Z:/Serien/Show 1 to /media/Serien/Show 1

Related: https://github.com/Sonarr/Sonarr/issues/2394

Most helpful comment

I got it to work.

  • I downloaded SQL Lite Browser
  • I used the following queries to replace the paths:

    • RootFolders -> Manually update to /media/

    • UPDATE Series SET Path = REPLACE(Series.Path, 'Z:\Serien\', '/media/Serien/')

    • UPDATE EpisodeFiles SET RelativePath = REPLACE(EpisodeFiles.RelativePath, '\', '/')

    • UPDATE SubtitleFiles SET RelativePath = REPLACE(SubtitleFiles.RelativePath, '\', '/')

  • Following the restore process in the wiki

If you are using the docker image linuxserver/sonarr you need to set /tv/ as (root) path since your folder mapping will translate to folder tv in the docker image.

>All comments

I got it to work.

  • I downloaded SQL Lite Browser
  • I used the following queries to replace the paths:

    • RootFolders -> Manually update to /media/

    • UPDATE Series SET Path = REPLACE(Series.Path, 'Z:\Serien\', '/media/Serien/')

    • UPDATE EpisodeFiles SET RelativePath = REPLACE(EpisodeFiles.RelativePath, '\', '/')

    • UPDATE SubtitleFiles SET RelativePath = REPLACE(SubtitleFiles.RelativePath, '\', '/')

  • Following the restore process in the wiki

If you are using the docker image linuxserver/sonarr you need to set /tv/ as (root) path since your folder mapping will translate to folder tv in the docker image.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leftl picture leftl  路  3Comments

markus101 picture markus101  路  3Comments

sparkie3 picture sparkie3  路  3Comments

Taloth picture Taloth  路  4Comments

sam3d picture sam3d  路  3Comments