Announcement

Collapse
No announcement yet.

Synchronize XBMC Database to XBMC devices

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Synchronize XBMC Database to XBMC devices

    Here have been playing with multiple XBMC clients and would prefer to utilize one DB for all of the clients. I am currently utilizing MythTV for live TV streaming and MythTV uses mysql for its database.

    1 - SSH to MythTV box
    2 - login as root mysql user
    Code:
    root@ICS-MythTV:~# mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 178
    Server version: 5.5.32-0ubuntu0.12.04.1 (Ubuntu)
    Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    mysql>
    3 - create XBMC user
    Code:
    mysql>CREATE USER 'xbmc' IDENTIFIED BY 'xbmc';
    4 - create xbmc databases

    Code:
    mysql>CREATE database MyVideos;
    Code:
    mysql>CREATE database MyMusic;
    5 - grant user access to databases

    Code:
    mysql>GRANT ALL ON *.* TO 'xbmc';
    6 - confirmation that the above is OK.

    Code:
    mysql>SELECT host,user from mysql.user;
    Code:
    +-----------+------------------+
    | host      | user             |
    +-----------+------------------+
    | %         | mythtv           |
    | %         | xbmc             |
    | 127.0.0.1 | root             |
    | ::1       | root             |
    | localhost |                  |
    | localhost | debian-sys-maint |
    | localhost | mythtv           |
    | localhost | root             |
    +-----------+------------------+
    10 rows in set (0.00 sec)
    Code:
    mysql>SHOW DATABASES;
    Code:
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mysql              |
    | mythconverg        |
    | performance_schema |
    | test               |
    | MyMusic         |
    | MyVideos         |
    +--------------------+
    7 rows in set (0.04 sec)
    7 - configure XBMC to use your new database

    - export your video and music databases (its under XBMC settings in video or music) to anything (share, USB stick et al).
    - export DB's will be utilized for import to your new mysql DB
    - create a text file (copy and paste the following changing the host "*"'s to your MythTV IP
    HTML Code:
    <advancedsettings>
    <videodatabase>
    <type>mysql</type>
    <host>***.***.***.***</host>
    <port>3306</port>
    <user>xbmc</user>
    <pass>xbmc</pass>
    </videodatabase> 
    <musicdatabase>
    <type>mysql</type>
    <host>***.***.***.***</host>
    <port>3306</port>
    <user>xbmc</user>
    <pass>xbmc</pass>
    </musicdatabase>
    <videolibrary>
              <importwatchedstate>true</importwatchedstate>
         </videolibrary>
    </advancedsettings>

    - save the file as "advancedsettings.xml"
    - copy the file to in
    WINDOWS -
    %APPDATA%\XBMC\userdata
    LINUX-
    ~/.xbmc/userdata
    OS X -
    ~/Library/Application Support/XBMC/userdata
    8 - copy the above file to all of your XBMC installations

    9 - start one of your XBMC applications and import the music and video libraries you exported earlier.

    10 - your XBMC boxes will keep the same databases between them.

    http://wiki.xbmc.org/index.php?title...tting_up_MySQL

    HOW-TO:Share libraries using MySQL/Sync thumbails and fanart From XBMC

    You can skip this step entirely if you are using XBMC v12 "Frodo". Frodo will automatically take care of thumbnail caching on each client for you and keep them in sync.
    http://wiki.xbmc.org/index.php?title...ils_and_fanart
    Last edited by Pete; August 22nd, 2013, 09:59 PM.
    - Pete

    Auto mator
    Homeseer 3 Pro - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU - Mono 6.00
    Homeseer Zee2 (Lite) - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.00

    X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

  • #2
    I've installed the profile now on 4 XBMC machines and it works well. A couple of ways to monitor your DB's on Ubuntu:

    1 - browser based - install Webmin
    2 - GUI based - install mysqlnavigator
    Attached Files
    Last edited by Pete; August 24th, 2013, 04:19 PM.
    - Pete

    Auto mator
    Homeseer 3 Pro - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU - Mono 6.00
    Homeseer Zee2 (Lite) - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.00

    X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

    Comment


    • #3
      I seemed to have corrupted the DB. It was probably my fault as I kept changing stuff. That said my Ubuntu MM XBMC box went into a boot loop when updating the DB yesterday night.

      Its not a big deal to install it again from scratch; will try again today using the DB on the device proper to see what happens.
      - Pete

      Auto mator
      Homeseer 3 Pro - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU - Mono 6.00
      Homeseer Zee2 (Lite) - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.00

      X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

      Comment


      • #4
        Really messed up the DB mixing in the XP drive mappings totally trashed the DB.

        For now on the UbuntuXBMC box went back to their own DB's. XP doing the same. Next steps are to wipe the DB. Have it recreated by the UbuntuXBMC box then wipe the XP DB's redo the drive mappings and then reload the DB. I should be OK afterwards.
        - Pete

        Auto mator
        Homeseer 3 Pro - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU - Mono 6.00
        Homeseer Zee2 (Lite) - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.00

        X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

        Comment

        Working...
        X