dannymichel 102 Posted October 4, 2019 Share Posted October 4, 2019 (edited) Lets say you want to move everything from /mnt/mergerfs/tv to /mnt/mergerfs/media/tv cd /var/lib/emby-server/data sqlite3 library.db UPDATE MediaItems SET Path= replace(Path, '/mnt/mergerfs', '/mnt/mergerfs/media') where Path like '%/mnt/mergerfs%'; UPDATE MediaStreams2 SET Path= replace(Path, '/mnt/mergerfs', '/mnt/mergerfs/media') where Path like '%/mnt/mergerfs%'; UPDATE TypedBaseItems SET Path= replace(Path, '/mnt/mergerfs', '/mnt/mergerfs/media') where Path like '%/mnt/mergerfs%'; .save library.db; .exit simple as that Edited October 4, 2019 by dannymichel 4 Link to comment Share on other sites More sharing options...
Luke 37112 Posted October 4, 2019 Share Posted October 4, 2019 Thanks for the info ! Link to comment Share on other sites More sharing options...
dannymichel 102 Posted October 4, 2019 Author Share Posted October 4, 2019 no problem Link to comment Share on other sites More sharing options...
spaceman07 8 Posted May 11, 2020 Share Posted May 11, 2020 (edited) hello.. i would like to add to this where the table TypedBaseItems does not exist anymore and i needed to update the options.xml files in the directories found under /opt/emby/root/default as my installation is via cloudbox dockers. hope it helps someone.. thanks Edited May 11, 2020 by spaceman07 1 Link to comment Share on other sites More sharing options...
Luke 37112 Posted May 12, 2020 Share Posted May 12, 2020 hello.. i would like to add to this where the table TypedBaseItems does not exist anymore and i needed to update the options.xml files in the directories found under /opt/emby/root/default as my installation is via cloudbox dockers. hope it helps someone.. thanks  Hi, the newer table is called MediaItems now. Link to comment Share on other sites More sharing options...
stavol23 0 Posted January 15, 2021 Share Posted January 15, 2021 (edited) Hi, Â Â Need help with same topic, i just need to change the library path of my media from "/mnt/gdrive" to "/mnt/unionfs". The contents of my media are both present in both directories just want to change the path in emby server. I tried doing the steps listed above with no success. Thanks. Â was able to figure it out, i needed to edit options.xml on library. Thanks. Edited January 15, 2021 by stavol23 Link to comment Share on other sites More sharing options...
neunghaha28 16 Posted March 8, 2021 Share Posted March 8, 2021 2021. Not working, Please update. Link to comment Share on other sites More sharing options...
Happy2Play 8296 Posted March 8, 2021 Share Posted March 8, 2021 5 minutes ago, neunghaha28 said: 2021. Not working, Please update. Sorry what is not working? But you would have to manually edit the database and each library options.xml. Link to comment Share on other sites More sharing options...
neunghaha28 16 Posted March 9, 2021 Share Posted March 9, 2021 (edited) On 3/8/2021 at 9:40 AM, Happy2Play said: Sorry what is not working? But you would have to manually edit the database and each library options.xml. Yes, I manually edit database and options.xml on embyserver beta 4.6.0.30 not working after from scan library again. Edited March 9, 2021 by neunghaha28 Link to comment Share on other sites More sharing options...
Luke 37112 Posted March 9, 2021 Share Posted March 9, 2021 What exactly is not working? Link to comment Share on other sites More sharing options...
neunghaha28 16 Posted March 9, 2021 Share Posted March 9, 2021 8 minutes ago, Luke said: What exactly is not working? Library is completely gone after another scan. Link to comment Share on other sites More sharing options...
Luke 37112 Posted March 10, 2021 Share Posted March 10, 2021 OK, I would try re-setting them up in emby library setup. 1 Link to comment Share on other sites More sharing options...
n3farious 2 Posted March 13, 2021 Share Posted March 13, 2021 I just wanted to provide some confirmation that editing the library.db and various options.xml worked fine for me today as of version 4.5.2.0 (I'm a little behind). Consolidating my paths was required to use hardlinking as I prepare to move to docker. It also simplifies my fstab a bit A few words of caution that should be best practice. Backup your .db and /xml files first. Make sure emby is down. You will probably have to chown the . and library.db to edit. Put it back to your emby user and group when you are done editing. Don't forget to edit your paths in any download apps, etc. When you first start emby back up and rescan your library, all of the images might appear to be gone and no content in each library. Give it some time. My libraries took almost two hours to complete scanning, and things were a bit wonky until the scans completed.  1 Link to comment Share on other sites More sharing options...
romankk 8 Posted March 19, 2021 Share Posted March 19, 2021 If somebody uses this to change the location of the media files, you might also need to run UPDATE MediaItems SET Images= replace(Images, '/mnt/mergerfs', '/mnt/mergerfs/media') where Images like '%/mnt/mergerfs%'; At least, it was missing for me. Link to comment Share on other sites More sharing options...
blim5001 8 Posted April 3, 2021 Share Posted April 3, 2021 I tried this... I changed all the paths in my DB, I changed the options.xml for each library. Started up emby, and all looks good (so I thought), all the libraries showed the new paths and I could play files. So then it came to running a scan and now emby is running ffprobe on all the files again. As these are files on google drive, it is taking ages. Is there a way to prevent emby from having to run this, as the files have not changed, just the paths? Thanks Link to comment Share on other sites More sharing options...
Luke 37112 Posted April 3, 2021 Share Posted April 3, 2021 Hi, this is something we'll look to improve in future updates. Thanks. Link to comment Share on other sites More sharing options...
boardbum 1 Posted April 14, 2021 Share Posted April 14, 2021 Just a question, but is there any particular reason Emby isn't set up to do this from the Setting section OR at setup after installation? Honestly, the first time I installed emby years ago on my small 120GB SSD I didn't realize that the metatdata would consume over 10GB of my drive. Maybe I should have but it was my first experience. Obviously I kept my media files on non SSD drives and it would have been nice to have a screen in setup asking where I wanted to have this data saved along with a warning that it could take up a large amount of space which is why a user might want to locate it somewhere else.  Thanks for all the great work! Link to comment Share on other sites More sharing options...
Luke 37112 Posted April 14, 2021 Share Posted April 14, 2021 6 hours ago, boardbum said: Just a question, but is there any particular reason Emby isn't set up to do this from the Setting section OR at setup after installation? Honestly, the first time I installed emby years ago on my small 120GB SSD I didn't realize that the metatdata would consume over 10GB of my drive. Maybe I should have but it was my first experience. Obviously I kept my media files on non SSD drives and it would have been nice to have a screen in setup asking where I wanted to have this data saved along with a warning that it could take up a large amount of space which is why a user might want to locate it somewhere else.  Thanks for all the great work! Yes it can be improved. Thanks for the feedback. Link to comment Share on other sites More sharing options...
neunghaha28 16 Posted July 21, 2021 Share Posted July 21, 2021 (edited) On 3/11/2021 at 12:15 AM, Luke said: OK, I would try re-setting them up in emby library setup. Error: no such table: TypedBaseItems. I ignored Error: no such table: TypedBaseItems. I'm just wondering if it's no longer in use? table: TypedBaseItems. After modifying the library.db, if I don't Scan media library Poster it stays and works. Scan media library found that the poster is missing. Embyserver 4.7.0.3 beta Edited July 21, 2021 by neunghaha28 Link to comment Share on other sites More sharing options...
Luke 37112 Posted July 21, 2021 Share Posted July 21, 2021 TypedBaseItems is no longer used in newer server versions. Link to comment Share on other sites More sharing options...
Happy2Play 8296 Posted July 26, 2021 Share Posted July 26, 2021 On 7/20/2021 at 8:26 PM, neunghaha28 said: Error: no such table: TypedBaseItems. I ignored Error: no such table: TypedBaseItems. I'm just wondering if it's no longer in use? table: TypedBaseItems. After modifying the library.db, if I don't Scan media library Poster it stays and works. Scan media library found that the poster is missing. Embyserver 4.7.0.3 beta You only updated Path, you would still need to update Images column. But yes the TypedBaseItems table is obsolete and does not exist in a New database, only OLD migrated databases. This happens over time on original installs and Emby changes. Link to comment Share on other sites More sharing options...
neunghaha28 16 Posted July 26, 2021 Share Posted July 26, 2021 5 hours ago, Happy2Play said: You only updated Path, you would still need to update Images column. But yes the TypedBaseItems table is obsolete and does not exist in a New database, only OLD migrated databases. This happens over time on original installs and Emby changes. how to update Images column? Link to comment Share on other sites More sharing options...
Happy2Play 8296 Posted July 26, 2021 Share Posted July 26, 2021 1 minute ago, neunghaha28 said: how to update Images column? Same as mentioned above. On 3/19/2021 at 10:34 AM, romankk said: If somebody uses this to change the location of the media files, you might also need to run UPDATE MediaItems SET Images= replace(Images, '/mnt/mergerfs', '/mnt/mergerfs/media') where Images like '%/mnt/mergerfs%'; At least, it was missing for me.  1 Link to comment Share on other sites More sharing options...
neunghaha28 16 Posted July 28, 2021 Share Posted July 28, 2021 (edited) @Happy2Play @Luke UPDATE MediaItems SET Path= replace(Path, '/volume1/rclone/mount', '/media/GoogleDrive') where Path like '%/volume1/rclone/mount%'; UPDATE MediaStreams2 SET Path= replace(Path, '/volume1/rclone/mount', '/media/GoogleDrive') where Path like '%/volume1/rclone/mount%'; UPDATE MediaItems SET Images= replace(Images, '/volume1/rclone/mount', '/media/GoogleDrive') where Images like '%/volume1/rclone/mount%'; .exit Scan media library (Failed) *** Error Report *** Version: 4.7.0.3 Command line: /app/emby/EmbyServer.dll -programdata /config -ffdetect /app/emby/ffdetect -ffmpeg /app/emby/ffmpeg -ffprobe /app/emby/ffprobe -restartexitcode 3 Operating system: Linux version 4.4.180+ (root@build13) (gcc version 7.5.0 (GCC) ) #41890 SMP Fri Jun 25 02:37:14 CST 2021 Framework: .NET Core 3.1.13 OS/Process: x64/x64 Runtime: app/emby/System.Private.CoreLib.dll Processor count: 4 Data path: /config Application path: /app/emby SQLitePCL.pretty.SQLiteException: Corrupt: database disk image is malformed SQLitePCL.pretty.SQLiteException: Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown. at SQLitePCL.pretty.SQLiteException.CheckOk(sqlite3 db, Int32 rc) at SQLitePCL.pretty.StatementImpl.MoveNext() at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItem(IDatabaseConnection db, BaseItem item, Int64 topParentId, Int64 userDataKeyId, IStatement insertItemStatement, IStatement updateItemStatement) at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItemsInTranscation(IDatabaseConnection db, List`1 tuples) at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItems(List`1 items, Action`1 afterSave, CancellationToken cancellationToken) Source: SQLitePCL.pretty TargetSite: Void CheckOk(SQLitePCLEx.sqlite3, Int32) 2021-07-28 17:58:53.359 Error App: Error refreshing James Grogan *** Error Report *** Version: 4.7.0.3 Command line: /app/emby/EmbyServer.dll -programdata /config -ffdetect /app/emby/ffdetect -ffmpeg /app/emby/ffmpeg -ffprobe /app/emby/ffprobe -restartexitcode 3 Operating system: Linux version 4.4.180+ (root@build13) (gcc version 7.5.0 (GCC) ) #41890 SMP Fri Jun 25 02:37:14 CST 2021 Framework: .NET Core 3.1.13 OS/Process: x64/x64 Runtime: app/emby/System.Private.CoreLib.dll Processor count: 4 Data path: /config Application path: /app/emby SQLitePCL.pretty.SQLiteException: Error: cannot rollback - no transaction is active SQLitePCL.pretty.SQLiteException: Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown. at SQLitePCL.pretty.SQLiteException.CheckOk(sqlite3 db, Int32 rc) at SQLitePCL.pretty.StatementImpl.MoveNext() at SQLitePCL.pretty.DatabaseConnection.Execute(IDatabaseConnection This, ReadOnlySpan`1 sqlUtf8) at SQLitePCL.pretty.DatabaseConnection.RollbackTransaction(IDatabaseConnection This) at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItems(List`1 items, Action`1 afterSave, CancellationToken cancellationToken) at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItems(List`1 items, CancellationToken cancellationToken) at Emby.Server.Implementations.Library.LibraryManager.UpdateItems(List`1 items, BaseItem parent, ItemUpdateType updateReason, Boolean setDateLastSaved, Boolean saveMetadata, CancellationToken cancellationToken) at Emby.Server.Implementations.Library.LibraryManager.UpdateItems(List`1 items, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken) at Emby.Server.Implementations.Library.LibraryManager.UpdateItem(BaseItem item, BaseItem parent, ItemUpdateType updateReason) at MediaBrowser.Controller.Entities.BaseItem.UpdateToRepository(ItemUpdateType updateReason) at MediaBrowser.Providers.Manager.MetadataService`2.SaveItem(MetadataResult`1 result, Boolean isFirstRefresh, LibraryOptions libraryOptions, ItemUpdateType reason, IDirectoryService directoryService, CancellationToken cancellationToken) at MediaBrowser.Providers.Manager.MetadataService`2.RefreshMetadata(BaseItem item, MetadataRefreshOptions refreshOptions, LibraryOptions libraryOptions, CancellationToken cancellationToken) at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadata(MetadataRefreshOptions options, LibraryOptions libraryOptions, CancellationToken cancellationToken) at Emby.Server.Implementations.Library.Validators.PeopleValidator.ValidatePeople(CancellationToken cancellationToken, IProgress`1 progress) Source: SQLitePCL.pretty TargetSite: Void CheckOk(SQLitePCLEx.sqlite3, Int32) How to fix? Edited July 28, 2021 by neunghaha28 Link to comment Share on other sites More sharing options...
Luke 37112 Posted July 28, 2021 Share Posted July 28, 2021 https://support.emby.media/support/solutions/articles/44002210894-corrupt-database Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now