Jump to content

Library folder change


Recommended Posts

Posted

This is not a server migration. It is just a simple moving my media folder to another local drive. So only the drive letter changes.

Is there an easy way to do this without losing my scanned collection and in progress media?

Happy2Play
Posted

Only if you are willing to manually edit the database and per library options.xml, while offline.

Similar to this.

 

  • Like 1
Posted

That would be extremely easy if I only have to edit the options.xml files.

Everything will move over, even the files in progress?

Posted

You need to update the database as well.

Posted

Yes, I just tested and updating options.xml is not enough. There are more things to do.

Change these

1- options.xml for each library

2- library.db

3- Any plugins that you may have like Trakt

What was easy was that I was able to edit the library.db with just a text editor.

Posted

I am still seeing traces of the old path. There are files with the extension .mblink for each library.

Dated 2016. What are these files? Old files? Can I delete them? They just have one line in them, the old path.

Posted
3 minutes ago, Zodler said:

What was easy was that I was able to edit the library.db with just a text editor.

Huh, what?

You can't edit the database with a text editor.  You have to use a SQL database tool.

Happy2Play
Posted (edited)
2 minutes ago, Zodler said:

I am still seeing traces of the old path. There are files with the extension .mblink for each library.

Dated 2016. What are these files? Old files? Can I delete them? They just have one line in them, the old path.

Those are obsolete.

.collection files will be in 4.5.

Edited by Happy2Play
  • Like 1
Posted
2 minutes ago, cayars said:

Huh, what?

You can't edit the database with a text editor.  You have to use a SQL database tool.

Yes, you can, I just did! 😁 I just used Notepad++ and did it in few seconds. I used the replace. There is only one trick. You can't for example search for F:\HTPC and replace it with M:\HTPC. You have to search for F:\\HTPC and replace with M:\\HTPC. You have to use 2 \.

Posted

Let me say it a different way.  You certainly don't want to edit your SQL database with a text editor. 

Text editors mark things with codes such as line feeds, character returns.  They treat certain characters as end of file markers etc.

SQL editors understand the data types of the fields, the lengths, foreign keys, indexes, etc that all come into play when data fields are changed.

You may have gotten extremely lucky but also likely corrupted your database as well.

Time will tell, but in the future don't do that!

Did you at least backup your database before you edited it?

  • Like 1
Happy2Play
Posted

Interesting as I can see this working, but I would be worried of corrupting the database.

  • Like 1
Posted

Yes, I understand what you are saying. I know some programming but I'm trying to do things the easiest way possible. So it was a test. I did it with notepad++ and the server is working right now, with resuming and everything. If anything breaks I will report later.

Yes I backed up the entire emby folder. It was 1.78 GB. I'm wondering how big are other people's folders. I don't have that much stuff in my library. I don't keep everything in the library. I watch and delete. I keep the files separate from emby.

Posted

I've got my fingers crossed for you.  With the change you made it's likely you're ok but I'd advocate using a tool designed for editing the database next time.

Granted it wouldn't have been as easy as the replace you did but one SQL command could have done the upgrade and we could have helped you with it.

It's essentially a "replace" update command as well.

Happy2Play
Posted
6 minutes ago, Zodler said:

Yes I backed up the entire emby folder. It was 1.78 GB. I'm wondering how big are other people's folders.

62.5Gb on my main server.

Posted

Size is going to be influenced heavily by your settings to store graphics in with your media or not and ESPECIALLY BIF/Index files.  If you don't store the bif files with your media (and use them) you can easily be in the multi-terabyte range.

Posted
1 hour ago, Happy2Play said:

62.5Gb on my main server.

Wow 🤯 For how many items?

Happy2Play
Posted
1 minute ago, Zodler said:

Wow 🤯 For how many items?

About 6700 movies and 45,000 episodes.  But you add the trailers plugin for additional people for items you don't have.

Posted (edited)

Does the database get smaller when you delete movies, series by windows explorer or does it only grow in size?

Does it remove the unneeded images automatically when items are deleted outside of Emby?

Edited by Zodler
Posted

Hi,

A lot of metadata like graphics is not stored in the database but in folders on your file system.  These are removed if not needed (ie delete movie).  The database is mostly just rows of "text" data that keeps track of what you have and locations on your system where this info can be found.  When something is deleted the rows are removed from the DBs.  The database itself isn't big at all and any deleted rows can be reused so the DB doesn't need to shrink all the time if something is removed.  The DBs do support shrinking and removing extra space that can be ran once in a while to "tune up" the DB.

In a nutshell if you add and remove media often in Emby it will cleanup after itself and you shouldn't have any out of control growth if that's what you're wondering about.

Does that help?

Posted

By database I don't mean the one file library.db. That is of course nothing big since I already edited it by notepad++. I mean the whole thing. The whole Emby that is taking 1.78 GB of space. I have it in portable mode so everything is in one folder.

I don't delete content inside Emby with the Emby interface. I delete my media directly myself by windows explorer. I'm wondering if that is ok. When I delete a movie file by windows explorer, will Emby server also remove the graphics of that movie (not deleted by emby interface).

Posted

Emby will cleanup itself as it notices movies/shows removed from disc.

The only downside to this is the errors you can get between scans if you try to play something that no longer exists.

If you have "Enable real time monitoring" for the library turned on this is probably not a problem either.

  • 9 months later...
Posted

Hi, Sorry to jump in on the end of this.

Have to move a large library to a new drive and would very much like to just update the paths etc as well.

Any chance someone could provide a step by step guide to do that?

Have got a hold of 'Database Browser Portable' if that helps. Happy to use another program if that makes it easier. (open source or freeware preferred though).

Running Win 10 Pro 2H1 64bit.

Any help would be Much Appreciated!

 

 

Carlo
Posted

Why don't you shut down Emby, move the data to the new disc, then set that new disc to the same drive letter you had before?
That way Emby will not know anything changed.

  • Thanks 1
Posted
1 hour ago, cayars said:

Why don't you shut down Emby, move the data to the new disc, then set that new disc to the same drive letter you had before?
That way Emby will not know anything changed.

Thanks for the quick reply. Yeah great idea. I forgot to mention that I already have another library on the 'New' disk (K:) and that's exactly what I did. Worked a treat. However I have an another library on a very old drive (P:) that I also want to put on (K:) as it new will provide plenty of storarge for both librarys.

Carlo
Posted

If you add or move other folders to the new drive Emby will scan them and change entries as needed but the more you keep on the same path the faster the scan will be.'Emby Server will adjust regardless as long as the paths (new or old) are listed as mount points in each lib.

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