Jump to content

Change Path to network shares


Go to solution Solved by cd01,

Recommended Posts

Posted

Hi,

 

I have changed the hostname for my fileserver resulting in emby not finding any files, to my horrific discovery i cannot just edit the path of each share in the webgui to the new path, i have to manually DELETE the share and then add it again resulting in a full rescan of everything.

 

Having over 10 million objects this is not something i want to do. Where can i find the data in the actual raw configs so i can just search/replace the path to the new path? Not being able to change path to shares without deleting/adding them again seems like a terrible solution to, maybe something to change for the future?

 

Thanks.

Posted (edited)

So the trouble here is i've manually added artwork to over 100 folders... adding a new path and deleting the old will update the database to use the old ffmpeg generated data, but all the manually entered artworks are lost.

 

I am now doing something i probably shouldn't be doing...

 

But i'm exploring the database file library.db, i found that mediaitems contains all the paths to the source files,

 

doing a simple replace query like

 

UPDATE MediaItems
SET Path = replace(path, 'oldpath', 'newpath');

 

This change + modifying the root/mblink and xml files hopefully works, this will take awhile, wish me luck :P

Edited by cd01
Posted

looks like it worked, i understand that you don't allow path changes in the gui because it took around 5 minutes to execute the query to replace all the paths in the database.. it would most likely time out over the web resulting in a half in half fixed database if you have a lot of items like me.

  • Solution
Posted (edited)

So if anyone want to change their media paths for all the libraries on emby windows server without having to loose any of the custom artwork you have applied to folders or wait for emby to rebuild the library on the new path do the following:

 

* WARNING NO WARRANTY, backup your database before doing anything.

 

Shutdown your emby server

Download: https://sqlitebrowser.org/

Install it and open Emby-Server\programdata\data\library.db

 

Run the sql query:

 

* replace oldpath with whatever your oldpath was

* replace newpath with whatever your new path is

 

UPDATE MediaItems
SET Path = replace(path, 'oldpath', 'newpath');

UPDATE MediaItems
SET Images = replace(images, 'oldpath', 'newpath');

 

Once you've ran these 2 queries write the changes to the database by clicking "Write to database"

 

Once that is done go to: Emby-Server\programdata\root

 

Search for *mblink

 

Open all mblink files in notepad ++ and use search/replace function.

 

Replace your old path, with your new path.

 

Save all the mblink files.

 

Now go to: Emby-Server\programdata\root

 

Search for *xml

 

Open all xml files in notepad ++ and use search/replace function.

 

Replace your old path, with your new path.

 

Start your emby server

 

Voila, everything is like normal like nothing changed but if you go into your library configuration you'll see there are new paths there.

Edited by cd01

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...