Kodi Community Forum
[Release] Backup (formerly XBMC Backup) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: [Release] Backup (formerly XBMC Backup) (/showthread.php?tid=129499)



RE: [Release] Backup (formally XBMC Backup) - robweber - 2015-02-14

If you look a little farther down though it says "request token not properly authorized by user". Something is not lining up between you and the Dropbox site. Make sure you authorize the app before you hit OK in the dialog.


RE: [Release] Backup (formally XBMC Backup) - Oath - 2015-02-16

(2015-02-14, 16:49)robweber Wrote: If you look a little farther down though it says "request token not properly authorized by user". Something is not lining up between you and the Dropbox site. Make sure you authorize the app before you hit OK in the dialog.

Hi thank you for your development of this script. would love to get it working but I keep getting scrip failed when i launch it to backup. here is the error log.

Code:
08:41:48 T:18446744073617772808  NOTICE: Thread LanguageInvoker start, auto delete: false
08:41:48 T:18446744073617772808  NOTICE: -->Python Interpreter Initialized<--
08:41:50 T:18446744073617772808  NOTICE: script.xbmcbackup-1.0.3: Starting
08:41:50 T:18446744073617772808  NOTICE: script.xbmcbackup-1.0.3: Local Dir: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/
08:41:50 T:18446744073617772808  NOTICE: script.xbmcbackup-1.0.3: Remote Dir: 201502160841/
08:41:50 T:18446744073617772808  NOTICE: script.xbmcbackup-1.0.3: Mode - Backup
08:41:50 T:18446744073617772808   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.TypeError'>
                                            Error Contents: writestr() got an unexpected keyword argument 'compress_type'
                                            Traceback (most recent call last):
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-master/default.py", line 69, in <module>
                                                backup.run(mode)
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-master/resources/lib/backup.py", line 157, in run
                                                writeCheck = self._createValidationFile()
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-master/resources/lib/backup.py", line 521, in _createValidationFile
                                                success = self.remote_vfs.put(xbmc.translatePath(utils.data_dir() + "xbmcbackup.val"),self.remote_vfs.root_path + "xbmcbackup.val")
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-master/resources/lib/vfs.py", line 100, in put
                                                self.zip.writestr(utils.encode(dest),aFile.read(),compress_type=zipfile.ZIP_DEFLATED)
                                            TypeError: writestr() got an unexpected keyword argument 'compress_type'
                                            -->End of Python script error report<--

Thanks!


RE: [Release] Backup (formally XBMC Backup) - robweber - 2015-02-17

I would uncheck the "compress backups" option. I see you are running on an Android platform. It appears whatever version of Python that is on that box does not like the "compress_type" option being set on the zip archive. I did some searching an it appears that the 2.6 version of Python did not include this as a valid argument while the 2.7.9 version does. Kodi has 2.6 or higher "depending on platform" so Android must be at the tail end of this. Every platform I've tested up until now has always had this flag available. Disabling compression will work until I can find a work around.


RE: [Release] Backup (formally XBMC Backup) - Oath - 2015-02-17

(2015-02-17, 16:01)robweber Wrote: I would uncheck the "compress backups" option. I see you are running on an Android platform. It appears whatever version of Python that is on that box does not like the "compress_type" option being set on the zip archive. I did some searching an it appears that the 2.6 version of Python did not include this as a valid argument while the 2.7.9 version does. Kodi has 2.6 or higher "depending on platform" so Android must be at the tail end of this. Every platform I've tested up until now has always had this flag available. Disabling compression will work until I can find a work around.

Thank you very much for the reply :] That seems to have done the trick!


RE: [Release] Backup (formally XBMC Backup) - forrest1110 - 2015-03-09

Posted by ed_davidson - 2015-02-08 22:38
I am using Backup. The only issue I have is that when I restore from a backup I can't get the skin settings that I had previously. I'm not sure if this is called the guisettings.xml file. If i manually copy the userdata and addons folder from the backed up file without Kodi running, everything is restored fine. Is there a way round this other then copy the folders manually without Kodi running?

Posted by robweber - 2015-02-06 09:56
It should work on any instance as long as the Kodi version is the same. Just be aware of the guisettings.xml issue as that will most likely have the personalization information you're concerned with.

*****

So, please forgive me as I am having a little trouble understanding the process of restoring the Skin settings and personalizations when doing a restore....

Am I correct that you can navigate to your backup files... say you keep them on an SMB share (external HDD over the network)... Then copy and paste that over the one that is restored aka the generic skin file or add it to where that guisettings.xml should be?

I have a fire tv (android) and kodi 14.2... i know the FAQ lists some putty and ssh directions but i dont do that anymore on my system since i switched from apple tv....

learning how to do this and save my Skin personalized set up ie. backgrounds and main menu favorite shortcuts for my Amber skin would be AMAZING...


RE: [Release] Backup (formally XBMC Backup) - forrest1110 - 2015-03-11

(2015-02-09, 04:38)ed_davidson Wrote: I am using Backup. The only issue I have is that when I restore from a backup I can't get the skin settings that I had previously. I'm not sure if this is called the guisettings.xml file. If i manually copy the userdata and addons folder from the backed up file without Kodi running, everything is restored fine. Is there a way round this other then copy the folders manually without Kodi running?

(2015-02-09, 21:31)robweber Wrote: You only need to copy the guisettings file - this is all the skin specific settings. No other way when Kodi is running to to this, although several have been proposed none have been adopted into the mainline branch. The FAQ explains this a little better but it's just a limitation at the moment.

(2015-03-09, 21:33)forrest1110 Wrote: Posted by ed_davidson - 2015-02-08 22:38
I am using Backup. The only issue I have is that when I restore from a backup I can't get the skin settings that I had previously. I'm not sure if this is called the guisettings.xml file. If i manually copy the userdata and addons folder from the backed up file without Kodi running, everything is restored fine. Is there a way round this other then copy the folders manually without Kodi running?

Posted by robweber - 2015-02-06 09:56
It should work on any instance as long as the Kodi version is the same. Just be aware of the guisettings.xml issue as that will most likely have the personalization information you're concerned with.

*****

So, please forgive me as I am having a little trouble understanding the process of restoring the Skin settings and personalizations when doing a restore....

Am I correct that you can navigate to your backup files... say you keep them on an SMB share (external HDD over the network)... Then copy and paste that over the one that is restored aka the generic skin file or add it to where that guisettings.xml should be?

I have a fire tv (android) and kodi 14.2... i know the FAQ lists some putty and ssh directions but i dont do that anymore on my system since i switched from apple tv....

learning how to do this and save my Skin personalized set up ie. backgrounds and main menu favorite shortcuts for my Amber skin would be AMAZING...

SOLUTION....

This would probably work for any skin settings as it worked for my custom Amber set up, Its not exactly easy but.... it is a solution none the less....at least for android users...(Fire TV for me... and Fire TV Stick)

I beleive you can just copy the addons and userdata folders to the kodi system folders while kodi is not running and get the same result as doing a system restore...but what actually worked for me....was...

Note: the reason a system backup doesnt restore all the skin custom settings is i believe the guisettings.xml file reads and writes over on startup and shutdown (rudimentary understanding)... So when you copy the GUIsettings.xml file over the current one, you have to hit FORCE STOP in the app manager on FIRE TV

STEPS:
Ran the BACKUP addon upon first run of KODI 14.2 (same version as the one i backed up) and restored my desired backup file...

Side loaded ES File Explorer 3... easily findable with a google search....***important to turn on Show Hidden Files option in settings*** (took me a while to figure that out...)

Watched a video on you tube on how to navigate to the desired folders within the android setup (again searched GUIsettings.xml on youtube)

I actually linked up my google drive account to the ES file explorer and stored the copied GUIsettings.xml from the fully set up KODI with amber configured how I like it....(I used file manager within KODI to copy the guisettings.xml found in my userdata folder to a folder on my SMB external HDD which i then moved to my google drive account)

From there, I just copied the fully configured guisettings.xml from my google drive account over the guisettings.xml file in my newly restored KODI and.... VOILA..... my set up was revived... Smile Big GrinBig GrinBig GrinRoflRoflRofl

Been trying to figure this one out for a while.... Im very happy... haha... I hope this helps some others...


RE: [Release] Backup (formally XBMC Backup) - robweber - 2015-03-12

You are correct, while Kodi is running any attempts to restore the guisettings file are in vain as Kodi will write to this file whatever it has in memory right before it closes. You have to copy the file while the application is off (or kill the app instead of exiting correctly). Since this file contains all the visual settings (skin settings, views, etc) most people think their restore didn't work when really it's just this one file.

Just as an FYI, the Backup addon does write a guisettings.xml.restore file when doing a restore within the userdata folder. If you have a file browser utility on your Kodi device you can simply rename this file when Kodi is not running instead of having to try and figure out a way to copy it over from scratch.

I've been trying to work on a patch for this but I'm having trouble getting all the dependencies for Isengard to build at the moment. There was a pull request for Helix that attempted to solve this issue, along with a few others, but I think it got too convoluted and it didn't gain interest. I think if I can simply the code to just fixing this one issue it may get merged in.


RE: [Release] Backup (formally XBMC Backup) - forrest1110 - 2015-03-12

awesome... that would be excellent if you could incorporate that into the regular backup process... Thank you for all the hard work... saving people a ton of headaches... !!


RE: [Release] Backup (formally XBMC Backup) - kobbra - 2015-03-13

Hi and thanks for a great app Smile

I have 2 issues.. 1: sometimes the backup will duplicate all files making the backup twice as big.. i have looked at logs but cant seem to see any diffrence between the two backups.. 2: custom folders paths seems a bit strange when i look inside the backup file the custom folders just contains a few files at 0kb in size

also about the guisetting file.. isnt it possible to put in a reboot as with the advancedsettings file? i think most users could live with always have to reboot when restoring.

Best Regards


RE: [Release] Backup (formally XBMC Backup) - robweber - 2015-03-13

Hi,

To solve the duplicate, or custom folder issues I'll really need a debug log. I know you've looked but it's sort of a "pics or it didn't happen" type of thing. Can't troubleshoot what I can't see.

As far as the guisettings goes, a reboot command won't work unfortunately. If you have an advancedsettings file in your restore you are prompted to reboot - as Kodi will leave this file alone and simply read it back in on reboot. For guisettings the problem is that one of the last things Kodi does on shutdown (or reboot) is take the in-memory settings and dump them back to the file. So essentially you're restoring the "correct" file and then Kodi just just overwriting the "incorrect" settings again anyway. You'd have to actually kill the Kodi process while it was running to bypass this.

In my opinion, an elegant way to handle this would just be to look for a file like "guisettings.xml.restore" when Kodi starts. If present, copy that to guisettings.xml and keep on trucking. This way you could copy your settings to the "restore" file while Kodi was running, reboot, and it would read in the restore information without having to modify any of the current guisettings read/write operations. This is what I'm attempted to write a patch to do, just haven't had time to complete it. (any enterprising c++ coders feel free to do this for me! post a link to your github pull request and I'll gladly support it - c++ is not my strongest language so stuff like this takes me a while).


RE: [Release] Backup (formally XBMC Backup) - kobbra - 2015-03-13

Hi

I will try to post some debug logs but since this doesnt happen with all backups its a bit tricky to get one.. I tried to trigger one manually with debug mode on but the backup was created correctly.

The scheduled backup made this past night actually made 4 copies of each file :S Image

does the app it self have a debug mode or do i have to run kodi debug?


RE: [Release] Backup (formally XBMC Backup) - kobbra - 2015-03-13

Hi

I will try to post some debug logs but since this doesnt happen with all backups its a bit tricky to get one.. I tried to trigger one manually with debug mode on but the backup was created correctly.

The scheduled backup made this past night actually made 4 copies of each file :S Image

does the app it self have a debug mode or do i have to run kodi debug?


RE: [Release] Backup (formally XBMC Backup) - robweber - 2015-03-13

You can run Kodi in debug log mode as the addon uses the xbmc.LOGDEBUG flag to figure out if it should print a log entry or not.

I do see you are using the Zip file option. Something that just crossed my mind is that there may be an issue with how the zip file is being created. The first thing it tries to do is delete the old zip archive staging area located in special://temp. If that is failing (debug log will show) then you will get a second copy of all the files stacked into the first archive, if this happens again you'll get thirds, fourths, and so on. If the process completes you'd be back to the one.

Please run a debug log but I imagine that is what is happening here.


RE: [Release] Backup (formally XBMC Backup) - infoweb - 2015-03-15

Hi there,

Having trouble restoring a backup.

I have 2 openelec boxes (old one / new one) old one running generic 64 bit build the new one running on a cuboxtv - both are running the same latest version of openelec 5.0.6

The generic 64 bit is my original box - so I wanted to backup and migrate all my settings.

the backup goes fine - I can backup and save the files.

the trouble is when I come to restore.

I have setup the path on the new box and it gives me the option to select which file to restore.

Once I select the file to restore it sits there working for a few minutes, then I get the following error:

Error: Remote Path doesn't exist

storage/.kodi/temp/datexxxx

It seems to try to unpack the selected file to a temporary location but then fails.

Any suggestions how I can get around this issue?


RE: [Release] Backup (formally XBMC Backup) - robweber - 2015-03-16

If you want you could unpack the file yourself in the original remote directory and have it pull from the unpacked file instead of the zipped one. I'd need a debug log to see why the zip archive is failing to copy and unzip correctly if that isn't something you want to try.