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 (formerly XBMC Backup) - CiNcH - 2020-08-27

The Python 3.8.5 patch has now gone into master. So starting tomorrow, Backup 1.6.3 will not be functional with Matrix nightlies anymore.


RE: [Release] Backup (formerly XBMC Backup) - CodyLane - 2020-08-27

(2020-08-27, 09:37)CiNcH Wrote: The Python 3.8.5 patch has now gone into master. So starting tomorrow, Backup 1.6.3 will not be functional with Matrix nightlies anymore.

All of us obviously owe a huge debt to all of you who write these awesome scripts, and understand what Python is and why it was "patched", etc. 

Visiting other tech forums I also can't possibly understand - the "initial post" is usually updated as to whether everything is working or not? For instance, the post reads that only the GitHub release is working - is that still the case? ie - should I be downloading and installing from GitHub rather than the repository inside Kodi? 

I'm not possibly going to understand any of this. I just click some stuff and it works? Or it doesn't work - and, other than posting here whatever "details" my idiocy might share about what "happened" - I'm completely useless?

And if you're not even responding to my query, but just updating the other gurus about the state of Python and Matrix - I apologize for littering the forum. 

Is there a link or a button I can "click on" that will alert me when everything is simply back to working again? ;) Thanks!


RE: [Release] Backup (formerly XBMC Backup) - vurt - 2020-08-27

I too am wondering what I'm meant to do, should do, or can do as a user. I've asked about how to install the latest plugin from Github because I can't get Git Browser to show any results when I searched for the repo.


RE: [Release] Backup (formerly XBMC Backup) - jeffski10 - 2020-09-08

Is there a way to stop the log getting spammed with  WARNING: SMBFile::OpenForWrite() called with overwriting enabled!    rows when the backup is running?  I don't see any debug settings option in the addon so not sure where there is coming from?


RE: [Release] Backup (formerly XBMC Backup) - vurt - 2020-09-08

(2020-08-27, 13:01)CodyLane Wrote:
(2020-08-27, 09:37)CiNcH Wrote: The Python 3.8.5 patch has now gone into master. So starting tomorrow, Backup 1.6.3 will not be functional with Matrix nightlies anymore.

All of us obviously owe a huge debt to all of you who write these awesome scripts, and understand what Python is and why it was "patched", etc. 

Visiting other tech forums I also can't possibly understand - the "initial post" is usually updated as to whether everything is working or not? For instance, the post reads that only the GitHub release is working - is that still the case? ie - should I be downloading and installing from GitHub rather than the repository inside Kodi? 

I'm not possibly going to understand any of this. I just click some stuff and it works? Or it doesn't work - and, other than posting here whatever "details" my idiocy might share about what "happened" - I'm completely useless?

And if you're not even responding to my query, but just updating the other gurus about the state of Python and Matrix - I apologize for littering the forum. 

Is there a link or a button I can "click on" that will alert me when everything is simply back to working again? Wink Thanks!

If it helps, the older version that I had from the Kodi repository seemed to still be working? I can see the up-to-date backups the addon is making, it last made a backup on Sep 6 for me.

Today, I just managed to figure out how to manually install the latest 1.5.2 version from the GitHub because Git Browser never worked for me.

(I have no idea if 1.5.2 works since that's your question, but the version on Kodi repo is pretty outdated so I'll update and see what happens.)

If you refer to the OP where it says "Most Current Version (Krypton+)", that link brings you to the version on GitHub: https://github.com/robweber/xbmcbackup/tree/krypton-1.5.2

On that page, you'll see a green Code button near the top right:
Image

(There's also a 1.5.3 version but since it wasn't mentioned in the OP, I had no idea if it works so I didn't try.)

Download it as ZIP. Then put it on a Flash drive or external storage, a folder that Kodi can see. Go to your Addons in Kodi, and select the Install from Zip option, browse to the folder you put the ZIP in, and click to install. You should see a notification about Dropbox API installed, and addon updated—at least that's what I saw.

After that, restart Kodi. You HAVE TO RESTART. Go find the Backup addon, click on Information, and you should see it's now showing 1.5.2.

I just went through those steps to update the addon.


RE: [Release] Backup (formerly XBMC Backup) - CiNcH - 2020-09-12

(2020-08-19, 17:22)CiNcH Wrote: The update to Python 3.8.5 (see PR) seems to be causing an exception in Backup 1.6.3 on Android, see report.

FIXED


RE: [Release] Backup (formerly XBMC Backup) - bsoriano - 2020-12-11

@robweber , I am trying to get rid of any skin.helper.service dependencies of my skin, Amber.  One of them is the skin.helper.skinbackup.  I am trying to replicate the limited functionality of that addon, using your addon.  I would only like to backup the Kodi config, the skin settings (skin addon data) and the script.skinshortcuts settings (addon data).  I am using your addon, version 1.5.3, with Kodi 18.9. 

I created a backup set that has just what I would like to backup.  Since I saw that the custom paths json file uses relative paths, potentially the same json file should work independently of what OS Kodi is used in.  I would like to include with the skin a custom paths json file, and then from the skin call the addon using the backup set included with the skin.  Is this possible? I could not find that you can add any parameter to the backup call.  If not, would you consider adding this functionality? I hope I am explaining correctly what I am trying to achieve.

Please let me know.  Thanks.

Regards,

Bart


RE: [Release] Backup (formerly XBMC Backup) - robweber - 2020-12-23

(2020-12-11, 00:04)bsoriano Wrote: @robweber , I am trying to get rid of any skin.helper.service dependencies of my skin, Amber.  One of them is the skin.helper.skinbackup.  I am trying to replicate the limited functionality of that addon, using your addon.  I would only like to backup the Kodi config, the skin settings (skin addon data) and the script.skinshortcuts settings (addon data).  I am using your addon, version 1.5.3, with Kodi 18.9. 

I created a backup set that has just what I would like to backup.  Since I saw that the custom paths json file uses relative paths, potentially the same json file should work independently of what OS Kodi is used in.  I would like to include with the skin a custom paths json file, and then from the skin call the addon using the backup set included with the skin.  Is this possible? I could not find that you can add any parameter to the backup call.  If not, would you consider adding this functionality? I hope I am explaining correctly what I am trying to achieve.

Please let me know.  Thanks.

Regards,

Bart

I think I follow what you're trying to do. You'd like to have a pre-built JSON file that defines a backup set that you kick off a backup with - does that sound right? There is a limited script functionality but nothing to pass in a defined json file. You'd want something like this: 
Code:


# in python
RunScript(script.xbmcbackup, mode=backup, json=path/to/json.json)

# using JSON RPC

{ "jsonrpc": "2.0", "method": "Addons.ExecuteAddon","params":{"addonid":"script.xbmcbackup","params":{"mode":"backup","json":"path/to/json.json"}}, "id": 1 }


That's a pretty interesting idea. I can see how this would be useful. One question I have is what would the backup location look like? Would you want to send this to the default location as defined in the addon settings or have some other spot this would go? I guess it depends on how much user configuration you want to happen here. If your skin could detect if "script.xbmcbackup" is installed and then either prompt to install or show the "backup" button that could work. Something on my end to figure out is the naming of the result file. Right now all backups are just folders named with the date the backup was done. We'd want to append something to that showing that this was done outside of the addon's normal backup routines. Is this kind of the idea you're going for?


RE: [Release] Backup (formerly XBMC Backup) - bsoriano - 2020-12-23

(2020-12-23, 21:28)robweber Wrote:
(2020-12-11, 00:04)bsoriano Wrote: @robweber , I am trying to get rid of any skin.helper.service dependencies of my skin, Amber.  One of them is the skin.helper.skinbackup.  I am trying to replicate the limited functionality of that addon, using your addon.  I would only like to backup the Kodi config, the skin settings (skin addon data) and the script.skinshortcuts settings (addon data).  I am using your addon, version 1.5.3, with Kodi 18.9. 

I created a backup set that has just what I would like to backup.  Since I saw that the custom paths json file uses relative paths, potentially the same json file should work independently of what OS Kodi is used in.  I would like to include with the skin a custom paths json file, and then from the skin call the addon using the backup set included with the skin.  Is this possible? I could not find that you can add any parameter to the backup call.  If not, would you consider adding this functionality? I hope I am explaining correctly what I am trying to achieve.

Please let me know.  Thanks.

Regards,

Bart

I think I follow what you're trying to do. You'd like to have a pre-built JSON file that defines a backup set that you kick off a backup with - does that sound right? There is a limited script functionality but nothing to pass in a defined json file. You'd want something like this: 
Code:


# in python
RunScript(script.xbmcbackup, mode=backup, json=path/to/json.json)

# using JSON RPC

{ "jsonrpc": "2.0", "method": "Addons.ExecuteAddon","params":{"addonid":"script.xbmcbackup","params":{"mode":"backup","json":"path/to/json.json"}}, "id": 1 }


That's a pretty interesting idea. I can see how this would be useful. One question I have is what would the backup location look like? Would you want to send this to the default location as defined in the addon settings or have some other spot this would go? I guess it depends on how much user configuration you want to happen here. If your skin could detect if "script.xbmcbackup" is installed and then either prompt to install or show the "backup" button that could work. Something on my end to figure out is the naming of the result file. Right now all backups are just folders named with the date the backup was done. We'd want to append something to that showing that this was done outside of the addon's normal backup routines. Is this kind of the idea you're going for?

@robweber, thanks for answering! You understood perfectly what I am trying to do. Right now the skin prompts you to install the addon if it is not installed when you click on the Backup button I have in the skin settings area. I know that at a minimum, the user needs to select a backup location in the addon settings; I will provide with the skin a pre-built JSON file. It would be awesome to call the script as you put before (with a JSON parameter that accepts relative paths (like special://skin/extras/backup/Amber backup.json, for example).

I appreciate your willingness to consider this. Please let me know how I can be of further assistance (if you add this, I will do all of the testing that you need. I can test under Windows (Leia and Matrix), Android (Leia) and LibreELEC (Leia)).

Regards,

Bart


RE: [Release] Backup (formerly XBMC Backup) - robweber - 2020-12-26

(2020-12-23, 21:40)bsoriano Wrote:
(2020-12-23, 21:28)robweber Wrote:
(2020-12-11, 00:04)bsoriano Wrote: @robweber , I am trying to get rid of any skin.helper.service dependencies of my skin, Amber.  One of them is the skin.helper.skinbackup.  I am trying to replicate the limited functionality of that addon, using your addon.  I would only like to backup the Kodi config, the skin settings (skin addon data) and the script.skinshortcuts settings (addon data).  I am using your addon, version 1.5.3, with Kodi 18.9. 

I created a backup set that has just what I would like to backup.  Since I saw that the custom paths json file uses relative paths, potentially the same json file should work independently of what OS Kodi is used in.  I would like to include with the skin a custom paths json file, and then from the skin call the addon using the backup set included with the skin.  Is this possible? I could not find that you can add any parameter to the backup call.  If not, would you consider adding this functionality? I hope I am explaining correctly what I am trying to achieve.

Please let me know.  Thanks.

Regards,

Bart

I think I follow what you're trying to do. You'd like to have a pre-built JSON file that defines a backup set that you kick off a backup with - does that sound right? There is a limited script functionality but nothing to pass in a defined json file. You'd want something like this: 
Code:


# in python
RunScript(script.xbmcbackup, mode=backup, json=path/to/json.json)

# using JSON RPC

{ "jsonrpc": "2.0", "method": "Addons.ExecuteAddon","params":{"addonid":"script.xbmcbackup","params":{"mode":"backup","json":"path/to/json.json"}}, "id": 1 }


That's a pretty interesting idea. I can see how this would be useful. One question I have is what would the backup location look like? Would you want to send this to the default location as defined in the addon settings or have some other spot this would go? I guess it depends on how much user configuration you want to happen here. If your skin could detect if "script.xbmcbackup" is installed and then either prompt to install or show the "backup" button that could work. Something on my end to figure out is the naming of the result file. Right now all backups are just folders named with the date the backup was done. We'd want to append something to that showing that this was done outside of the addon's normal backup routines. Is this kind of the idea you're going for?

@robweber, thanks for answering! You understood perfectly what I am trying to do. Right now the skin prompts you to install the addon if it is not installed when you click on the Backup button I have in the skin settings area. I know that at a minimum, the user needs to select a backup location in the addon settings; I will provide with the skin a pre-built JSON file. It would be awesome to call the script as you put before (with a JSON parameter that accepts relative paths (like special://skin/extras/backup/Amber backup.json, for example).

I appreciate your willingness to consider this. Please let me know how I can be of further assistance (if you add this, I will do all of the testing that you need. I can test under Windows (Leia and Matrix), Android (Leia) and LibreELEC (Leia)).

Regards,

Bart

Thanks. I tried to flesh out this addition in a Github Issue: https://github.com/robweber/xbmcbackup/issues/175 

I reference an already open issue to define a Backup Task type object. I think this needs to be completed and then layer in the scripting capabilities you've come up with. The Task idea will allow for different JSON files to define sets of files to backup and each be stored separately in the remote directory. Once that is completed extending the scripting functionality should be easily done. I'll PM you when I'm ready to test this so you can see if it meets your requirements.


RE: [Release] Backup (formerly XBMC Backup) - fandangos - 2021-01-06

(2019-12-22, 18:45)CiNcH Wrote:
Quote:You can install version 1.6.0 from the releases page though. This contains the Dropbox code embedded with the addon code. In order to be accepted to the Kodi repo I had to strip this out into it's own addon so until the Dropbox lib is in the Matrix repo I can't push and updated version for general use. Hope this helps.

Installs fine now. But when trying to restore from a backup, I still get an error.

txt:

2019-12-22 17:43:16.524 T:26187   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <class 'KeyError'>
                                            Error Contents: 'directories'
                                            Traceback (most recent call last):
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/default.py", line 92, in <module>
                                                backup.restore()
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/resources/lib/backup.py", line 282, in restore
                                                restoreSets = [n['name'] for n in valFile['directories']]
                                            KeyError: 'directories'
                                            -->End of Python script error report<--

Didn't try to create a backup til now.

Looks like the whole Py3 is in very early stages. Hardly anything works properly on Android TV.

So, I was tired of doing the backup myself and decided to try this addon. 

I would like to ask if the restore function ever worked on Leia?

I'm having this exact same problem with Leia trying to restore a backup and Leia 18.9 Final uses Python 2.7.15.

I was looking at the matrix build of this addon and this exact line that fails is exactly the same on both:
Quote:            # use a multiselect dialog to select sets to restore
            restoreSets = [n['name'] for n in valFile['directories']]

I don't know python at all but this seems like a syntax error.

@robweber do you happen to know how to write it in a way python 2 could work?


RE: [Release] Backup (formerly XBMC Backup) - robweber - 2021-01-08

(2021-01-06, 00:23)fandangos Wrote:
(2019-12-22, 18:45)CiNcH Wrote:
Quote:You can install version 1.6.0 from the releases page though. This contains the Dropbox code embedded with the addon code. In order to be accepted to the Kodi repo I had to strip this out into it's own addon so until the Dropbox lib is in the Matrix repo I can't push and updated version for general use. Hope this helps.

Installs fine now. But when trying to restore from a backup, I still get an error.

txt:

2019-12-22 17:43:16.524 T:26187   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <class 'KeyError'>
                                            Error Contents: 'directories'
                                            Traceback (most recent call last):
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/default.py", line 92, in <module>
                                                backup.restore()
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/resources/lib/backup.py", line 282, in restore
                                                restoreSets = [n['name'] for n in valFile['directories']]
                                            KeyError: 'directories'
                                            -->End of Python script error report<--

Didn't try to create a backup til now.

Looks like the whole Py3 is in very early stages. Hardly anything works properly on Android TV.

So, I was tired of doing the backup myself and decided to try this addon. 

I would like to ask if the restore function ever worked on Leia?

I'm having this exact same problem with Leia trying to restore a backup and Leia 18.9 Final uses Python 2.7.15.

I was looking at the matrix build of this addon and this exact line that fails is exactly the same on both:
Quote:            # use a multiselect dialog to select sets to restore
            restoreSets = [n['name'] for n in valFile['directories']]

I don't know python at all but this seems like a syntax error.

@robweber do you happen to know how to write it in a way python 2 could work?

What version of the addon did you use to make the backup? Is it the same as the one you're using to restore? The error you're getting is because the key "directories" doesn't exist in the validation file. There was a change to the programming done when the ability to make backup sets was added. It expects the directories key to be available as part of the validation file when you're restoring. One way to check is to look at the contents of the xbmcbackup.val file in the directory where the backup is stored.


RE: [Release] Backup (formerly XBMC Backup) - fandangos - 2021-01-08

(2021-01-08, 00:55)robweber Wrote: What version of the addon did you use to make the backup? Is it the same as the one you're using to restore? The error you're getting is because the key "directories" doesn't exist in the validation file. There was a change to the programming done when the ability to make backup sets was added. It expects the directories key to be available as part of the validation file when you're restoring. One way to check is to look at the contents of the xbmcbackup.val file in the directory where the backup is stored.

I got it from main Kodi repo.
Now I see 1.1.3

So basically using 1.5.4 will solve this?

There's no directories in the validation file.


RE: [Release] Backup (formerly XBMC Backup) - robweber - 2021-01-09

(2021-01-08, 01:43)fandangos Wrote: I got it from main Kodi repo.
Now I see 1.1.3

So basically using 1.5.4 will solve this?

There's no directories in the validation file.

 I guess yes/no. There was a breaking change when the Backup Tasks were added. Any backups made prior to the Backup Tasks addition won't restore using a version after that. My best recommendation is to use the same version for the backup and restore process. If this is what you are doing I guess that wasn't clear from your description. The full backup and restore process is tested on each release.


RE: [Release] Backup (formerly XBMC Backup) - fandangos - 2021-01-09

(2021-01-09, 17:16)robweber Wrote:
(2021-01-08, 01:43)fandangos Wrote: I got it from main Kodi repo.
Now I see 1.1.3

So basically using 1.5.4 will solve this?

There's no directories in the validation file.

 I guess yes/no. There was a breaking change when the Backup Tasks were added. Any backups made prior to the Backup Tasks addition won't restore using a version after that. My best recommendation is to use the same version for the backup and restore process. If this is what you are doing I guess that wasn't clear from your description. The full backup and restore process is tested on each release.

Yes it was a fault on my end.
Sorry for that.

I had version 1.1.3 installed when I made the backup.

It's working properly now with 1.5.4 with the zip fix added.

Thank you for this addon it's really helpful.