Backing up the XBMC on AppleTV2

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
djrobsd Offline
Junior Member
Posts: 3
Joined: Feb 2011
Reputation: 0
Post: #1
Hi,

Search for the word Backup returned hundreds of results, sorry for asking something that may have already been answered (feel free to post link). Wink

I want to backup my XBMC config, database, scraping, etc.. I have been putting a lot of work into adding all my content into XBMC, setting things up just the way I want, and I'd hate to start from scratch!! I already had to once, when my AppleTV2 lost network connectivity and the only way to fix it was to restore to default apple config then rejailbreak and reinstall XBMC...

So if there is a way for me to backup my stuff, and be able to restore it later, that would be awesome! Let me know! I'm assuming it involves SSH into AppleTV, then using ftp or scp to transfer the files to a remote location. Wink
find quote
Dmaster1981 Offline
Junior Member
Posts: 7
Joined: Feb 2011
Reputation: 0
Post: #2
The simplest way i know of to do this is to Grab yourself a copy of Filezilla for what ever Operating system your on and ssh in using IP: YourAppleIP User: root Password: alpine Port: 22 then navigate your way to /private/var/mobile/Library/Preferences/XBMC and you will find every thing your looking for. If your setup is anything like mine it may take a while Smile Hope this helps
find quote
Fergus Offline
Senior Member
Posts: 152
Joined: Jan 2006
Reputation: 0
Location: Scotland
Post: #3
Doesn't hurt to export your video library into individual .nfo files along with your fanart too (System/Video/Library/Export Library). That way, you can add your content back into your library without needing to access the external scrapers again and choose your preferred thumbs/backdrops all over again.

If your content is on a NAS or SMB share (and therefore in a different disk from your XBMC library database) then ('watched' markers aside) a fresh install of XBMC on a fresh machine will quickly rebuild the video, database as soon as you set up your sources, without the delay of scraping all over again.
find quote
sah602 Offline
Junior Member
Posts: 49
Joined: Nov 2009
Reputation: 0
Post: #4
Fergus, awesome tip! I have been playing with XBMC for over a year now and have never tried exporting my library before. Loving this lil thing called ATV2!
find quote
mischi Offline
Junior Member
Posts: 14
Joined: Sep 2010
Reputation: 0
Post: #5
Can I backup my XBMC on my Mac and import it onto the ATV2 without problems? :O
find quote
Hidd3nFury Offline
Senior Member
Posts: 252
Joined: Apr 2009
Reputation: 0
Post: #6
mischi Wrote:Can I backup my XBMC on my Mac and import it onto the ATV2 without problems? :O

Yes!
find quote
valkur Offline
Junior Member
Posts: 30
Joined: Jun 2009
Reputation: 0
Location: Canada
Post: #7
After restoring your XBMC directory, you may experiance problems adding content or marking items as watched. You cant write to the files.

If you do, log into the ATV and run this command:

Code:
chown -R mobile:mobile /private/var/mobile/Library/Preferences/XBMC

This will reset the proper permissions on the files.
find quote
fihzy Offline
Junior Member
Posts: 6
Joined: Jan 2011
Reputation: 0
Post: #8
valkur Wrote:After restoring your XBMC directory, you may experiance problems adding content or marking items as watched. You cant write to the files.

If you do, log into the ATV and run this command:

Code:
chown -R mobile:mobile /private/var/mobile/Library/Preferences/XBMC

This will reset the proper permissions on the files.

Is it right to say that if I recursively backup /private/var/mobile/Library/Preferences/XBMC that will contain everything I need to return a wiped atv2 back to how I wanted it? Screensaver choices, sources, library, watched flags, overscan settings? The whole thing? Thinking about setting up a passwordless ssh backup from my nas on a nightly basis. A restore is as simple as rejailbreaking, installing atv2, and then recursively restoring files and permissions?

Cheers
find quote
valkur Offline
Junior Member
Posts: 30
Joined: Jun 2009
Reputation: 0
Location: Canada
Post: #9
Yuppers, I have done it several times while tinkering, I can have my ATV2 restored in 20 minutes and still have it tell me all the shows I watched, my theme, settings, everything.

**That being said, please make sure you understand what your doing before blaming me if it goes PooF Smile

To restore your Settings, you would of course Restore your ATV2, Jailbreak it, install XBMC (and then your unofficial if thats the route you are going). Then you just upload said directory and chown -R to reset the permissions. Ready to go.
find quote
Adam Z Offline
Junior Member
Posts: 5
Joined: Feb 2011
Reputation: 0
Post: #10
Rsync works well for backups.

- install rsync daemon on the Appletv:

$apt-get install rsync

- run rsync from your workstation

$rsync -avz root@0.0.0.0:/private/var/mobile/Library/Preferences/XBMC /Volumes/Media/XBMC_backup/private/var/mobile/Library/Preferences/XBMC
find quote
mischi Offline
Junior Member
Posts: 14
Joined: Sep 2010
Reputation: 0
Post: #11
Is there anyway to get my "watched tags" from XBMC on my Mac to the XBMC on my ATV2 ?
find quote
AlessandroSS Offline
Member
Posts: 77
Joined: Nov 2009
Reputation: 0
Location: Brazil
Post: #12
I'm not sure if the problem I have is the same being discussed in this topic but is related to importing my movie database to ATV2. I use XBMC with my iMac and all files of my movies and TV shows collection are stored in a Time Capsule in the network, now I'd like to use this same database with XBMC in ATV2.

The video files in Time Capsule can be played from XBMC on ATV2 already, I added a source with the same name I have in the XBMC of the iMac.

I exported the video database from the XBMC of the iMac and imported it in the XBMC of the ATV2. The movies images and fanarts appear in the collection on ATV2 but when I try to play them from the collection it does not work.

Probably the problem is related to the path of the sources, as in iMac I was able to mount the Time Capsule.

iMac:
source name: "Movies"
path: /Volumes/Data/Videos/Movies


ATV2:
source name: "Movies"
path: smb://10.0.1.3/Data/Videos/Movies


Thanks!
find quote
valkur Offline
Junior Member
Posts: 30
Joined: Jun 2009
Reputation: 0
Location: Canada
Post: #13
Mischi - Yes you can, i did it a while back. The database is in your userdata folder. You could move it from one install to another. You may need to change the paths in the database though, check out this link http://wiki.xbmc.org/index.php?title=The_XBMC_Database

Also, and for AlessandroSS, search the forum for Mysql database, you can have multiple machines share the database.
find quote
mischi Offline
Junior Member
Posts: 14
Joined: Sep 2010
Reputation: 0
Post: #14
Thanks Valkur Smile Yesterday I figured, I could setup a MySQL database and synch with its help - which I then did Smile
find quote
Roums Offline
Junior Member
Posts: 42
Joined: Feb 2011
Reputation: 0
Post: #15
I transfered myXBMC database to AppleTV2 successfully, without loosing my Thumbnails (and I lost some time to find such an easy way to do it).

First, I have my XBMC installation on my Windows computer, and files are on the local hard drives, like D:\, E:\,....
If you share those folders in order to access them from your AppleTV2, or if you move your files, there are changes that you will loose your thumbnails as the CRC32 in their names will change.

Here is what I did, it is easy and works fine:

Let's say that you had your movies in "E:\Movies\" and now they will be on an SMB share, for example : "smb://HostComputer/Movies/" (it can be nfs share, or simply moving your files on the same computer too, it doesn't matter)

Go on your computer (Linux/MacOSX/Windows/??), System/Video/Library/Export
Choose a path where you want to export it

Go to the place where you created the backup (eg: C:\backup) and edit the following file :

Quote:C:\backup\xbmc_videodb_YYYY-MM-DD\videodb.xml

You will find things like that:


Quote:<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<videodb>
<movie>
<title>8th Wonderland</title>
<originaltitle>8th Wonderland</originaltitle>
<rating>0.000000</rating>
<epbookmark>0.000000</epbookmark>
<year>2008</year>
<top250>0</top250>
<votes>0</votes>
<outline>Des millions de personnes disséminées de par le monde et déçues de la manière dont celui-ci évolue décident de s&apos;unir. Toutes guidées par le même désir d&apos;améliorer les choses, de ne plus subir l&apos;actualité sans pouvoir réagir. Par le biais d&apos;Internet, elles créent le premier Pays virtuel : 8th Wonderland. Chaque semaine, tous ses habitants votent par référendum une motion différente... Mais que se passerait-il si les motions de 8th Wonderland devenaient petit à petit plus réactionnaires ? Si sa manière d&apos;agir se rapprochait lentement mais sûrement d&apos;un comportement terroriste ? Un problème insoluble se poserait alors à l&apos;ensemble des Nations.Comment combattre un pays qui n&apos;existe pas ?</outline>
<plot>Des millions de personnes disséminées de par le monde et déçues de la manière dont celui-ci évolue décident de s&apos;unir. Toutes guidées par le même désir d&apos;améliorer les choses, de ne plus subir l&apos;actualité sans pouvoir réagir. Par le biais d&apos;Internet, elles créent le premier Pays virtuel : 8th Wonderland. Chaque semaine, tous ses habitants votent par référendum une motion différente... Mais que se passerait-il si les motions de 8th Wonderland devenaient petit à petit plus réactionnaires ? Si sa manière d&apos;agir se rapprochait lentement mais sûrement d&apos;un comportement terroriste ? Un problème insoluble se poserait alors à l&apos;ensemble des Nations.Comment combattre un pays qui n&apos;existe pas ?</plot>
<tagline></tagline>
<runtime>1h 45min</runtime>
<thumb preview="http://passion-xbmc.org/scraper/Gallery/preview/Poster_8thWonderland-240361.jpg">http://passion-xbmc.org/scraper/Gallery/main/Poster_8thWonderland-240361.jpg</thumb>
<fanart>
<thumb preview="http://passion-xbmc.org/scraper/Gallery/preview/Fanart_8thWonderland-240360.jpg">http://passion-xbmc.org/scraper/Gallery/main/Fanart_8thWonderland-240360.jpg</thumb>
<thumb preview="http://passion-xbmc.org/scraper/Gallery/preview/Fanart_8thWonderland-240357.jpg">http://passion-xbmc.org/scraper/Gallery/main/Fanart_8thWonderland-240357.jpg</thumb>
<thumb preview="http://passion-xbmc.org/scraper/Gallery/preview/Fanart_8thWonderland-240356.jpg">http://passion-xbmc.org/scraper/Gallery/main/Fanart_8thWonderland-240356.jpg</thumb>
<thumb preview="http://passion-xbmc.org/scraper/Gallery/preview/Fanart_8thWonderland-240358.jpg">http://passion-xbmc.org/scraper/Gallery/main/Fanart_8thWonderland-240358.jpg</thumb>
<thumb preview="http://passion-xbmc.org/scraper/Gallery/preview/Fanart_8thWonderland-240359.jpg">http://passion-xbmc.org/scraper/Gallery/main/Fanart_8thWonderland-240359.jpg</thumb>
</fanart>
<mpaa>Couleur / Format du son : Dolby numérique / Format de projection : 1.85 : 1 / Format de production : 35 mm / Tourné en : Français</mpaa>
<playcount>0</playcount>
<lastplayed></lastplayed>
<file></file>
<path>E:\Movies\</path>
<filenameandpath>E:\Movies\8Th Wonderland (2010).avi</filenameandpath>
<id>1060234</id>
<genre>Drame</genre>
<genre> Thriller</genre>
<credits>Nicolas Alberny</credits>
<credits>Jean Mach</credits>
<director>Nicolas Alberny, Jean Mach</director>
<premiered></premiered>
<status></status>
<code></code>
<aired></aired>
<studio>Mad Films</studio>
<studio> Mad Films</studio>
<trailer></trailer>
<fileinfo>
<streamdetails>
<video>
<codec>xvid</codec>
<aspect>1.857143</aspect>
<width>624</width>
<height>336</height>
<durationinseconds>5653</durationinseconds>
</video>
<audio>
<codec>mp3</codec>
<language></language>
<channels>2</channels>
</audio>
</streamdetails>
</fileinfo>
<actor>
<name>Evelyne Macko</name>
<role>Yuichira</role>
<thumb>http://passion-xbmc.org/scraper/Gallery/main/EvelyneMacko-107472.jpg</thumb>
</actor>
<actor>
<name>Amanda Lear</name>
<role>elle-même</role>
<thumb>http://passion-xbmc.org/scraper/Gallery/main/AmandaLear-32728.jpg</thumb>
</actor>
</movie>


The lines that you will need to change are the following ones:

Quote: <path>E:\Movies\</path>
<filenameandpath>E:\Movies\8Th Wonderland (2010).avi</filenameandpath>

Change them to:

Quote: <path>smb://HostComputer/Movies/</path>
<filenameandpath>smb://HostComputer/Movies/8Th Wonderland (2010).avi</filenameandpath>

Now that you understood where is the information to change, you can just use "Search and Replace" on "E:\Movies\" to "smb://HostComputer/Movies/"

Once it is done save your file and place your backup somewhere on your new installation, if you intend to migrate to an AppleTV2, zip the folder, and upload it with pscp.exe:

Quote:pscp.exe xbmc_videodb.zip root@192.168.2.101:/private/var/mobile/

Login to your AppleTV2 with ssh go to /private/var/mobile and type:

Quote:unzip xbmc_videodb.zip

It will create a directory like : xbmc_videodb_YYYY-MM-DD

Also, check that your sources.xml are correct, for example in our example it will be:

Quote:<video>
<default pathversion="1"></default>
<source>
<name>Movies</name>
<path pathversion="1">smb://HostComputer/Movies/</path>
</source>
</video>

You can check it via SSH on your AppleTV by doing:

Quote:cat /private/var/mobile/Library/Preferences/XBMC/userdata/sources.xml

Now launch XBMC on your AppleTV or your new computer/same computer if you just moved your files

Go to System/Video/Library/Import Library and browse your computer for the backup (on the AppleTV, just click on "Home Folder" and you will be directly where your backup is)

Wait for XBMC to finish... and then fo to your video Library, all your files should be there, with the correspoding thumbnails/fan arts/informations and informations without having to scrap them again, very useful for the people like me with a slow connection or those your personnalized a lot the thumbnails/fan arts.
(This post was last modified: 2011-02-18 17:29 by Roums.)
find quote
Post Reply