Jump to content

DSM 6 to DSM 7 Emby Migration Instructions


Carlo

Recommended Posts

Been avoiding upgrading DSM 6 to 7 for sometime now but Xmas holidays have given me the time to give it a crack. Thanks for the detailed video and written instructions. I read every post in this thread before kicking it off.

I did run into the "no users" at the end and re-ran the 2 commands (having never used SSH before) and resolved that problem. Thanks guys.

Link to comment
Share on other sites

Hi, Glad everything worked out well for you.
Did you do this on New Years Eve?

Happy Holidays.

  • Like 2
Link to comment
Share on other sites

Adminelite
2 hours ago, cayars said:

Hallo, ich bin froh, dass alles für dich gut geklappt hat.
Hast du das an Silvester gemacht?

Frohe Feiertage.

Hallo ich habe eine Frage

Die Verbindung mit SMB geht nicht.

ich habe die Verbindung versucht:

smb:\\84.16.75.78\user:emby__PKG_<emby2021>\volume4\Media4\Test Pfad (Geht nicht)

Oder

smb:\\84.16.75.78\volume4\Media4\Test Pfad Geht nicht)

Oder

smb:\\84.16.75.78\user:emby__PKG_<emby2021>\volume4\Media4\Test Pfad Geht nicht)

Screenshot vom 01. 11.-39.-37. Januar

Screenshot vom 01. Januar 11-33-34.png

Screenshot vom 01. Januar 11-43-13.png

Edited by Adminelite
Link to comment
Share on other sites

That doesn't work well in Synology. What is preferred and works  is mounting the network share to the file system.
Than you just set it up like any other location on your system.

In file station use Tools->Mount Remote Folder->CIFS Shared Folder.
Fill out the proper info on the next page and you should be set.
In Emby you just navigate the directory tree and select the mount point.
image.png.03cc693357ea270372e929cfc1d14b04.png

Link to comment
Share on other sites

Nuitarius

I will share my solution based on the original post as my way into this issue is not 100% comparable.

Firstly, how I got here:
I updated DSM from 6.2 to 7.0.1 without thinking about Emby server at all.
After update, the DSM notified me of Emby server not compatible with current DSM and therfore not running.
I pressed the DSM link and was guided to Package Center where I could press "Repair". I did so.

Now my Emby server was running on 4.6.4 but was not working how I left it. It was as if it was a clean install.
After this I startet searching for others with similar issues and ended up in here.

I used the points in OP that made sense to me and fixed the issue:

1. Downloaded Emby 4.6.7 for DSM 7 (newest for ARMv7 that I need for my DS416j NAS)
2. Stopped current version 4.6.4 via Package Center
3. Did a manual install of new version 4.6.7
4. Removed emby_pkg via Control Panel -> User % Group
5. I gave my admin user read/write access to /VolumeX/Emby folder
6. I verified that a lot of data was still present here. E.g. I knew I had 3 users, so in /Emby/Config/Users I could see 3 folders with xml files. This was proof for me that the old settings were still present

Now I copied the data with the provided CLI commands:
1. Opened Control Panel -> Terminal & SNMP -> Enable SSH service (port 22)
2. Downloaded and installed PuTTY
3. Startet SSH session on my NAS IP
4. Logged in with admin credentials
5. cp -rv /volume3/Emby/* /volume3/@appdata/EmbyServer
6. chown -R emby:emby /volume3/@appdata/EmbyServer


From Control Panel go to Shared Folder and edit each share that is used by Emby Server.  Click the share, then EDIT, go to permission tab, select System internal user from drop down,
grant emby user read/write access.

start Emby

I verified on PC app, LG app and NVidia Shield app. All works, and my license is still active.

Thank you for a great product

PS: Will I have to do this everytime I upgrade my NAS?

Edited by Nuitarius
  • Like 1
Link to comment
Share on other sites

Hi,

Does noboby has issues with real time monitoring after migration?
It seems it doesnt scan for new files anymore, only after manually executing "Scan Library files"

Wkr,
Mo

Link to comment
Share on other sites

FrostByte
6 minutes ago, MrMo85 said:

Hi,

Does noboby has issues with real time monitoring after migration?
It seems it doesnt scan for new files anymore, only after manually executing "Scan Library files"

Wkr,
Mo

Could you post a server log which includes 10 mins of time after you added something new?  Thanks

Link to comment
Share on other sites

On 1/3/2022 at 7:00 AM, Nuitarius said:

Thank you for a great product

PS: Will I have to do this everytime I upgrade my NAS?

It's not great they don't give you a warning up front to check with any 3rd party software vendors before continuing.  That one message would save a lot of people grief!
The fact they try to do a "repair" makes you think it's going to be fixed but all it did was a new install which starts you out as if it's the first time loaded.

At that point you could have followed the migration instructions point for point starting from the DSM upgrade and been just fine.  You did a slight improv on it but essentially did what's needed so bravo on that!

Glad it all worked out in the end.

Minor OS releases like point releases shouldn't be an issue but I'd always check in with vendors in the future before doing a major Synology OS release.
If you happen to have a NAS model that does virtualization you can setup Synology running in a VM. Load up a small Emby test install (and any other important software) and do a dry run upgrade of the OS in this test environment.

That's what I do for testing to make sure everything works correctly first in the VM.

  • Thanks 1
Link to comment
Share on other sites

@MrMo85 If you take a look at your current Emby server log file do you see any warnings/errors about INOTIFY?
That's the process used by linux/Synology to notify software like Emby that content has changed.

The default values are low and almost always need raising. These tend to get reset to defaults on every DSM upgrade (point or full release) as well.

Link to comment
Share on other sites

17 hours ago, FrostByte said:

Could you post a server log which includes 10 mins of time after you added something new?  Thanks

@FrostByte

I see a lot of this errors (also for the tvshows and music):

2022-01-05 10:46:25.377 Error LibraryMonitor: Error watching path: /volume2/MOVIES/Movies
    *** Error Report ***
    Version: 4.6.7.0
    Command line: /volume1/@appstore/EmbyServer/system/EmbyServer.dll -programdata /var/packages/EmbyServer/var -ffdetect /var/packages/EmbyServer/target/bin/ffdetect -ffmpeg /var/packages/EmbyServer/target/bin/ffmpeg -ffprobe /var/packages/EmbyServer/target/bin/ffprobe -nolocalportconfig -ignore_vaapi_enabled_flag -pidfile /var/packages/EmbyServer/var/EmbyServer.pid -defaultdirectory /volume1/Public -updatepackage emby-server-synology7_{version}_x86_64.spk -noautorunwebapp
    Operating system: Linux version 4.4.180+ (root@build15) (gcc version 7.5.0 (GCC) ) #42218 SMP Mon Oct 18 19:17:56 CST 2021
    Framework: .NET Core 3.1.21
    OS/Process: x64/x64
    Runtime: volume1/@appstore/EmbyServer/system/System.Private.CoreLib.dll
    Processor count: 4
    Data path: /var/packages/EmbyServer/var
    Application path: /volume1/@appstore/EmbyServer/system
    System.IO.IOException: System.IO.IOException: The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached.
       at System.IO.FileSystemWatcher.StartRaisingEvents()
       at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()
       at Emby.Server.Implementations.IO.LibraryMonitor.<>c__DisplayClass37_0.<StartWatchingPath>b__0()
    Source: System.IO.FileSystem.Watcher
    TargetSite: Void StartRaisingEvents()

Link to comment
Share on other sites

10 hours ago, cayars said:

@MrMo85 If you take a look at your current Emby server log file do you see any warnings/errors about INOTIFY?
That's the process used by linux/Synology to notify software like Emby that content has changed.

The default values are low and almost always need raising. These tend to get reset to defaults on every DSM upgrade (point or full release) as well.

@cayars yes :(

The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached.

Link to comment
Share on other sites

muppet4k

Hi,

 

here are my Logfile:

 

    *** Error Report ***
    Version: 4.7.0.19
    Command line: /volume1/@appstore/EmbyServer/system/EmbyServer.dll -programdata /var/packages/EmbyServer/var -ffdetect /var/packages/EmbyServer/target/bin/ffdetect -ffmpeg /var/packages/EmbyServer/target/bin/ffmpeg -ffprobe /var/packages/EmbyServer/target/bin/ffprobe -nolocalportconfig -ignore_vaapi_enabled_flag -pidfile /var/packages/EmbyServer/var/EmbyServer.pid -defaultdirectory /volume1/Public -updatepackage emby-server-synology7_{version}_x86_64.spk
    Operating system: Linux version 4.4.180+ (root@build15) (gcc version 7.5.0 (GCC) ) #41890 SMP Thu Jul 15 03:43:42 CST 2021
    Framework: .NET 6.0.0-rtm.21522.10
    OS/Process: x64/x64
    Runtime: volume1/@appstore/EmbyServer/system/System.Private.CoreLib.dll
    Processor count: 4
    Data path: /var/packages/EmbyServer/var
    Application path: /volume1/@appstore/EmbyServer/system
    System.Exception: System.Exception: Error starting ffmpeg
       at Emby.Server.MediaEncoding.Api.BaseStreamingService.StartFfMpeg(StreamState state, String outputPath, CancellationToken cancellationToken, Boolean acquireResources)
       at Emby.Server.MediaEncoding.Api.Hls.BaseHlsService.ProcessRequest(StreamRequest request)
       at Emby.Server.Implementations.Services.ServiceController.GetTaskResult(Task task)
       at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, RestPath restPath, String responseContentType, CancellationToken cancellationToken)
       at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, ReadOnlyMemory`1 urlString, ReadOnlyMemory`1 localPath, CancellationToken cancellationToken)
    Source: Emby.Server.MediaEncoding
    TargetSite: Void MoveNext()
    
2022-01-05 13:06:32.981 Info App: ProcessRun 'StreamTranscode 1a3d59' Execute: /var/packages/EmbyServer/target/bin/ffmpeg -loglevel +timing -y -print_graphs_file "/var/packages/EmbyServer/var/logs/ffmpeg-transcode-1a3d5988-e055-4dae-a940-827496e93e39_1graph.txt" -copyts -start_at_zero -init_hw_device "vaapi=vad0:/dev/dri/renderD128" -filter_hw_device vad0 -analyzeduration 3000000 -stream_loop -1 -user_agent "VLC/3.0.0-git LibVLC/3.0.0-git" -multiple_requests 1 -reconnect_streamed 1 -reconnect_delay_max 2 -i "https://list.iptvcat.com/my_list/s/fdcff128e125539b43083c0c40eaa77b.m3u8" -filter_complex "[v:0]format@f1=pix_fmts=nv12,hwupload@f2,deinterlace_vaapi@f3[f3_out0]" -map [f3_out0] -map a:0 -sn -c:v:0 h264_vaapi -b:v:0 10000000 -maxrate:v:0 10000000 -bufsize:v:0 20000000 -force_key_frames:v:0 "expr:if(isnan(prev_forced_t),eq(t,t),gte(t,prev_forced_t+3))" -profile:v:0 high -level:v:0 3.1 -c:a:0 libmp3lame -ab:a:0 192000 -ac:a:0 2 -disposition:a:0 default -max_delay 5000000 -avoid_negative_ts disabled -f segment -map_metadata -1 -map_chapters -1 -segment_format mpegts -segment_list "/var/packages/EmbyServer/var/transcoding-temp/385372.m3u8" -segment_list_type m3u8 -segment_time 00:00:03.000 -segment_list_entry_prefix hls/385372/ -segment_start_number 0 -individual_header_trailer 0 -write_header_trailer 0 -segment_write_temp 1 "/var/packages/EmbyServer/var/transcoding-temp/385372_%d.ts"
2022-01-05 13:06:33.314 Info App: AppendExtraLogData - Read graph file: /var/packages/EmbyServer/var/logs/ffmpeg-transcode-1a3d5988-e055-4dae-a940-827496e93e39_1graph.txt
2022-01-05 13:06:33.314 Info App: AppendExtraLogData - Deserialized GraphData fileStream: {0:n} bytes Graph Count: 1
2022-01-05 13:06:33.314 Info App: AppendExtraLogData - File Deleted
2022-01-05 13:06:33.315 Info App: ProcessRun 'StreamTranscode 1a3d59' Process exited with code 1
2022-01-05 13:06:33.383 Info App: ProcessRun 'StreamTranscode 1a3d59' Execute: /var/packages/EmbyServer/target/bin/ffmpeg -loglevel +timing -y -print_graphs_file "/var/packages/EmbyServer/var/logs/ffmpeg-transcode-1a3d5988-e055-4dae-a940-827496e93e39_1graph.txt" -copyts -start_at_zero -analyzeduration 3000000 -stream_loop -1 -user_agent "VLC/3.0.0-git LibVLC/3.0.0-git" -multiple_requests 1 -reconnect_streamed 1 -reconnect_delay_max 2 -i "https://list.iptvcat.com/my_list/s/fdcff128e125539b43083c0c40eaa77b.m3u8" -filter_complex "[v:0]yadif@f1=mode=send_frame:parity=auto:deint=all,format@f2=pix_fmts=yuv420p[f2_out0]" -map [f2_out0] -map a:0 -sn -c:v:0 libx264 -maxrate:v:0 10000000 -bufsize:v:0 20000000 -pix_fmt:v:0 yuv420p -force_key_frames:v:0 "expr:if(isnan(prev_forced_t),eq(t,t),gte(t,prev_forced_t+3))" -preset:v:0 veryfast -profile:v:0 high -level:v:0 3.1 -x264opts:v:0 "subme=0:me_range=4:rc_lookahead=10:partitions=none" -crf:v:0 23 -c:a:0 libmp3lame -ab:a:0 192000 -ac:a:0 2 -disposition:a:0 default -max_delay 5000000 -avoid_negative_ts disabled -f segment -map_metadata -1 -map_chapters -1 -segment_format mpegts -segment_list "/var/packages/EmbyServer/var/transcoding-temp/385372.m3u8" -segment_list_type m3u8 -segment_time 00:00:03.000 -segment_list_entry_prefix hls/385372/ -segment_start_number 0 -individual_header_trailer 0 -write_header_trailer 0 -segment_write_temp 1 "/var/packages/EmbyServer/var/transcoding-temp/385372_%d.ts"
2022-01-05 13:06:33.710 Info App: AppendExtraLogData - Read graph file: /var/packages/EmbyServer/var/logs/ffmpeg-transcode-1a3d5988-e055-4dae-a940-827496e93e39_1graph.txt
2022-01-05 13:06:33.710 Info App: AppendExtraLogData - Deserialized GraphData fileStream: {0:n} bytes Graph Count: 1
2022-01-05 13:06:33.710 Info App: AppendExtraLogData - File Deleted
2022-01-05 13:06:33.711 Info App: ProcessRun 'StreamTranscode 1a3d59' Process exited with code 1
2022-01-05 13:06:33.737 Error Server: Error processing request
    *** Error Report ***

the last days it was everything fine... I didn't changed anything on that system... 😞

Link to comment
Share on other sites

FrostByte
3 hours ago, MrMo85 said:

@cayars yes :(

The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached.

You probably have maxed out inotify watches also.  

Create a scheduled task to run the following on boot and you should be good

sh -c '(sleep 90 && echo 204800 > /proc/sys/fs/inotify/max_user_watches)&'
sh -c '(sleep 90 && echo 10000 > /proc/sys/fs/inotify/max_user_instances)&'

 

Link to comment
Share on other sites

1 hour ago, FrostByte said:

You probably have maxed out inotify watches also.  

Create a scheduled task to run the following on boot and you should be good

sh -c '(sleep 90 && echo 204800 > /proc/sys/fs/inotify/max_user_watches)&'
sh -c '(sleep 90 && echo 10000 > /proc/sys/fs/inotify/max_user_instances)&'

 

@cayars Thx for the info! :)

Creating scheduled task in Synology?

Control Panel > Task Scheduler > Create > Triggerd Task > user defined script?

image.png.12d861c0bef73bf496e44f63a7e788c8.png

image.png.30cb9109701a18b4fba55428c386190d.png

 

Thxxx!

  • Like 1
Link to comment
Share on other sites

FrostByte

Looks good.  As long as that user has permissions you should be set now.

If you want, you could check to see if they took by typing this into terminal or putty

cat /proc/sys/fs/inotify/max_user_watches
cat /proc/sys/fs/inotify/max_user_instances

 

  • Like 1
Link to comment
Share on other sites

6 minutes ago, FrostByte said:

Looks good.  As long as that user has permissions you should be set now.

If you want, you could check to see if they took by typing this into terminal or putty

cat /proc/sys/fs/inotify/max_user_watches
cat /proc/sys/fs/inotify/max_user_instances

 

I got the following results:

max_user_watches = 8192
max_user_instances = 128

correct? :)

 

Link to comment
Share on other sites

FrostByte
6 minutes ago, MrMo85 said:

I got the following results:

max_user_watches = 8192
max_user_instances = 128

correct? :)

 

Those are the defaults.  After you run the task they should change to 204800 and 10000

Edited by FrostByte
Link to comment
Share on other sites

8 minutes ago, FrostByte said:

If it's not working, try changing the task user to 'root'

Thx @FrostByte & @cayars!

results are indeed now  204800 and 10000

Now testing if the real time monitoring works ( dont see the errors anymore about the inotify watches.

Keep you posted!

 

  • Like 2
Link to comment
Share on other sites

Awesome, glad you got it working.  With this script running as root and at bootup it will always reset values in the script to what you set them to.

Synology has a habit of setting this to defaults after an OS upgrade (even minor ones).  So feel free to add additional lines to this start up script down the road if you find other similar things that need resetting.

Link to comment
Share on other sites

Hi @FrostByte @cayars

 

Just want to tell you that the  real time monitoring works again like before! :D

Many thannks! :)

Ps: just a little question: The fix is that script on reboot, but i dont reboot my synology that offen :D
Any ideas the timeframe when i need to reboot the NAS or just wait untill the inotify instances will be reached again? 

Link to comment
Share on other sites

Chongwho

Hi Team,

I am in the same boat as many others where I think I have stuffed up the Emby upgrade. Everything has been running smoothly for 5 years without much hands on from me.

I hadn't updated to DSM 7 as yet, however just tried to manually upgrade to 4.6.7 which has reset my Emby Server.

I am not overly computer literate and a number of the steps on the instructions in the top post seem very daunting to me. I see that others have assisted with the upgrade via remoting in. If there was any chance someone could assist me with this I would be super appreciative. Otherwise I can try my best to follow the steps and just see how I go... I guess I always have backups if I stuff it up (although I'm not even sure how to restore a backup... do I need to downgrade back to the previous version I had?)

Thanks in advance.

Link to comment
Share on other sites

FrostByte
2 hours ago, MrMo85 said:

Hi @FrostByte @cayars

 

Just want to tell you that the  real time monitoring works again like before! :D

Many thannks! :)

Ps: just a little question: The fix is that script on reboot, but i dont reboot my synology that offen :D
Any ideas the timeframe when i need to reboot the NAS or just wait untill the inotify instances will be reached again? 

The reason it's in there during boot is because reboots and DSM upgrades tend to reset these types of changes back to default.  If you ever reach that number of watches/instances you will need to increase the number in the task before rerunning.  Those are some fairly high numbers though so you will need to have a very huge library to ever reach those limits 

Link to comment
Share on other sites

FrostByte
2 hours ago, Chongwho said:

Hi Team,

I am in the same boat as many others where I think I have stuffed up the Emby upgrade. Everything has been running smoothly for 5 years without much hands on from me.

I hadn't updated to DSM 7 as yet, however just tried to manually upgrade to 4.6.7 which has reset my Emby Server.

I am not overly computer literate and a number of the steps on the instructions in the top post seem very daunting to me. I see that others have assisted with the upgrade via remoting in. If there was any chance someone could assist me with this I would be super appreciative. Otherwise I can try my best to follow the steps and just see how I go... I guess I always have backups if I stuff it up (although I'm not even sure how to restore a backup... do I need to downgrade back to the previous version I had?)

Thanks in advance.

If you want to give it a shot just post up where you have questions.  Nothing gets deleted during the process so you can redo things if needed.  The part some don't feel comfortable with is when you need to use putty/terminal to copy your old configurations data to the new location.   However, it's still left in the old location so that step can be redone again. 

@cayars can help though if you want remote assistance at any point

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...