How to have a Central Database for all MediaPortal Clients
Related Plugins Synchronize ALL your MediaPortal databases and thumbs from a master client to a central location and then to other clients:
NOTE this is a configuration change that is not officially supported by the MediaPortal Team but forum members maybe able to assist in resolving issues. Some users have reported database corruption when more than one client access same database at a time. If you try this, ensure only one client is active at a time.
MediaPortal can store your music, movies and pictures in a SQLite database format. These databases are useful when you require a list of your collections and would like to do searches on them or if you have multiple storage locations and prefer a single list instead of explorer style viewing.
By default, the databases are created and stored on each PC containing MediaPortal. This has it's advantages (example - if one PC is for kids, you could setup that database to only show the kids movies and not adults), but in most cases, it becomes a hindrance when a new movie is added to the hard drive, and you then have to go around to each client and add it so it can be seen outside of the "Shares" View.
Having a centralized database requires you to have a few things setup on your network. Below is a guide on how to setup your centralized database so all clients will see the information but you will only have to update once.
Some Important Considerations about this Configuration Setup
- Your databases must be configured so that the files in the collection can be connected with that path from every Client machine. Therefore, if you have files in the database that are referenced as C:\Music\xxx.mp3, then every machine must have the file C:\Music\xxx.mp3. A way around this is to build your databases with your shares configured as UNC connection names. example \\ServerName\Music. This way it is easier to add a new client machine to view this share and it does not have to have a mapping on each machine.
- Only one person can edit the database at anyone time. This is a limitation with SQLite Databases.
- There may be issues when resuming from standby where the network card services are started after MediaPortal resumes which will cause failures in MediaPortal
How to set up Centralized Database
- First, you need to setup a share that all clients can connect to.
- Within that share, create 3 folders :- Database , Thumbs , Config
- on your MediaPortal PC, browse to the installation folder (usually C:\Program File\Team MediaPortal\MediaPortal) and find the file called MediaPortalDirs.xml and copy this to the Folder called Config created in step 2.
- on your MediaPortal PC, browse to the installation folder (usually C:\Documents and Settings\All Users\Application Data\Team MediaPortal\MediaPortal) and find the folder called Database. Select all the contents of this and copy to the newly created Database folder created in step 2.
- on your MediaPortal PC, browse to the installation folder (usually C:\Documents and Settings\All Users\Application Data\Team MediaPortal\MediaPortal) and find the folder called Thumbs. Select all the contents of this and copy to the newly created Thumbs folder created in step 2.
- Now that you have all the files in a central location, next is to modify the MediaPortalDirs.xml file in the Config folder on the Share drive.Open this file using NotePad or simliar text editor. You will need to scroll down the page until you find these lines:
All that needs to be done here is add in the path line, your server name and share name. An example is shown below with the server name being Garage10 and the share is called Mediaportal
Now you need to find the following for your thumbs.
All that needs to be done here is add in the path line, your serve rname and share name. An example is shown below
Now save and exit. All modifications have been done to the configuration files.
This "stike through" part does not preserve your changes when upgrading: Now from each MediaPortal PC client, you should make a backup or rename your local MediaPortalDirs.xml file (so you can roll back if problems arise) and then copy the modified file from the centralized location "Config" folder to the client PC (usually C:\Program File\Team MediaPortal\MediaPortal), and then start MediaPortal.
The next step is very important if you want the MediaPortal upgrade function to preserve your MediaPortalDirs.xml during upgrades.
You need to create a folder in your MyDocuments called "Team MediaPortal" and put your customized MediaPortalDirs.xml there. For example, you will then have C:\Users\htpc\Documents\Team MediaPortal\MediaPortalDirs.xml
All should now be working.