Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.2.1-rc3: Backup-Restore does not work #91

Closed
pz1 opened this issue Jan 14, 2016 · 31 comments
Closed

v2.2.1-rc3: Backup-Restore does not work #91

pz1 opened this issue Jan 14, 2016 · 31 comments
Assignees
Labels

Comments

@pz1
Copy link

pz1 commented Jan 14, 2016

Tried to move my installation to a new Raspi2 with new UZB1

  • Created new image with Jessie, installed this release with wget as instructed.
  • Restarted Pi. Could not restore z-way-backup-2016-01-14-15-21.zbk with ExpertUI.
  • Trying with SmartHome I got the following message:
    capture
@pz1
Copy link
Author

pz1 commented Jan 14, 2016

Found out in the meantime that I needed to set in Smarthome the correct Z-Way controller (UZB1 address) in ZWave configuration.

@pz1 pz1 closed this as completed Jan 14, 2016
@pz1
Copy link
Author

pz1 commented Jan 14, 2016

Sorry to have to reopen this.
After I performed the Restore with ExpertUI, nothing happened. No devices. After reboot the control window was no longer available in ExpertUI. All screen were pink with no information

@pz1 pz1 reopened this Jan 14, 2016
@pz1
Copy link
Author

pz1 commented Jan 14, 2016

On my test machine, which also runs v2.2.1-rc3 I also tried to make a backup from within SmartHome.
It seems to do something, but it is as yet unclear to me where it goes:
capture

@pz1 pz1 closed this as completed Jan 14, 2016
@pz1 pz1 reopened this Jan 14, 2016
@PoltoS
Copy link
Member

PoltoS commented Jan 14, 2016

Too many re-open and close ;)

In RC3 it might not work, try RC4 - it was tested

@pz1
Copy link
Author

pz1 commented Jan 15, 2016

Too many re-open and close ;)

Sorry, this happens when you are debugging and cooking a meal at the same time 😢

In RC3 it might not work, try RC4 - it was tested

It's release escaped to my attention. I'll upgrade

@pz1
Copy link
Author

pz1 commented Jan 15, 2016

Does the Smarthome Backup include the Z-Wave backup done via ExpertUI, or do we still have to make two backups?

The title "This will create a file that you can save to your computer" is not really meaningful to a user who wants to know what is written.
PS: I did find now a .zab file in my download directory
PS2: In Firefox I had set the download options to Always ask me where to save files, but that question was not asked. In ExpertUI I can choose the directory. (Chrome works OK)
PS3: The .zab does have an awkward unix timestamp in its name instead of a human-readable!

@michapr
Copy link

michapr commented Jan 15, 2016

I have tested (via Expert UI)
2.2.0 -> 2.2.0 => ok
2.2.1-rc4 -> 2.2.0 => ok
2.2.1-rc4 -> 2.2.1-rc4 => ok

in rc4 the backup process is not optimal this is right. For user is not clear, where update will be saved.
Would be nice if IP address could be added (if multiple devices present) - or user coud rename the backup before saving (and choose the right place)

@pz1
Copy link
Author

pz1 commented Jan 15, 2016

I have tested (via Expert UI)

This comment is on Smarthome; not ExpertUI.

@michapr
Copy link

michapr commented Jan 15, 2016

You were speaking about Expert-UI ;)
"After I performed the Restore with ExpertUI, nothing happened. No devices...."

@pz1
Copy link
Author

pz1 commented Jan 18, 2016

Does the Smarthome Backup include the Z-Wave backup done via ExpertUI, or do we still have to make two backups?

The title "This will create a file that you can save to your computer" is not really meaningful to a user who wants to know what is written.
PS: I did find now a .zab file in my download directory
PS2: In Firefox I had set the download options to Always ask me where to save files, but that question was not asked. In ExpertUI I can choose the directory
PS3: The .zab does have an awkward unix timestamp in its name instead of a human-readable!

bump

@PoltoS
Copy link
Member

PoltoS commented Jan 20, 2016

It does contain all data including Z-Wave, but does not do restore to UZB. Means, if same UZB is used, it will restore all data, but if new UZB is used, UZB will not receive any new data (requires Expert UI to restore)

@pz1
Copy link
Author

pz1 commented Jan 22, 2016

Thanks this helps understanding.
As a next step my aim is to create a fully functional exact copy (clone) of my installation to a spare RaspberryPi with a new UZB1. Can I do this 2 step (ExpertUI followed by .zab restore) operation without disrupting the production raspi2 ?

@pz1
Copy link
Author

pz1 commented Jan 27, 2016

Did some further testing:
a) Made under v2.2.1-rc4 a backups (EUI+Smarthome) from RaspberryB+RaZberry(3gen?).
b) Did restore from a) (EUI then Smarthome) to RaspberryPi2+UZB1(5gen).

  1. Had some initial trouble/misunderstanding of full restore with EUI, so I did a factory reset on UZB1. The EUI restore after that was successful.
  2. Next I did a restore of Smarthome. I did not see any of my Apps (userModules) restored. Not even after I had uploaded the sources to automation userModules.

I am afraid I lost my license key again after the factory reset. Could that explain that I don get my configured Apps back?

update 20150128 I probably misinterpreted losing the license key

@pz1
Copy link
Author

pz1 commented Feb 14, 2016

With v2.2.1-rc7 my Apps are still not restored. When can we finally expect a real robust backup/restore system? It is a real pain to have to rebuild from scratch

@ronie-z-wave ronie-z-wave self-assigned this Feb 15, 2016
@ronie-z-wave
Copy link
Contributor

Sorry, that we have let you wait so long.
It's an HA problem and that will be fixed now.

@pz1
Copy link
Author

pz1 commented Feb 19, 2016

In v2.2.1 userModules are not part of Backup/Restore. See forum

@pz1
Copy link
Author

pz1 commented Feb 22, 2016

Progressed a bit on this:

  • I should have copied my userModules to the new system before performing the restore
  • Most userModules did function properly, except where I have to select a virtualDevice from a dropdown menu:
    aritmetic

@ronie-z-wave
Copy link
Contributor

hmm, looks strange ... I need more informations about how you've copied the modules?

  • Simple copy in userModules folder with restart?
  • Did you add them to instances of config too?
  • sensors were still available?

@pz1
Copy link
Author

pz1 commented Feb 23, 2016

  • Simple copy in userModules folder with restart?
    yes
  • Did you add them to instances of config too?
    no, because I thought restore was going to fix/recreate config as well
  • sensors were still available?
    Yes, I think they were. Can't check it anymore since the device died again. I will run the experiment again while I am polishing my Backup/Restore description

@ronie-z-wave
Copy link
Contributor

fyi: We've decided to move restore functionality of userModules into v2.2.2. So we're now working on it.

If these userModules had existing instances before the backup, they should be in saved correctly, because HA makes no differents between /modules or /userModules apps. Of course if the app folders were missing the backup/restore of them is useless at the moment ...

I think not that this problem is related to backup/restore. Your Arithmetic module looks ok.
Could you please check if the devices are available in namespaces api?

/ZAutomation/api/v1/namespaces/devices_sensorMultilevel

with the folowing you get a list with ids and names of the devices:

/ZAutomation/api/v1/namespaces/devices_sensorMultilevel.deviceId
/ZAutomation/api/v1/namespaces/devices_sensorMultilevel.deviceName

I suspect that the device id is stored correctly but device itself isn't available in namespaces list so the list will be empty - maybe because it isn't a live or an interview has failed?

@pz1
Copy link
Author

pz1 commented Feb 23, 2016

/ZAutomation/api/v1/namespaces/devices_sensorMultilevel

The sensor is not found there, but if I look in configjson-xxxx.json, I do see under instances in the rule specification that my two missing sensors are mentioned there. I am pretty sure it is because it is not live. I will exchange the two devices now and see if the cloning went OK

@ronie-z-wave
Copy link
Contributor

Ah ok. So let me give you a short summary how it works:

As you know these namespaces were used by the apps to list devices.
But this list is updated depending on device events like created/destroy/removed or some metrics changes.

In your case no existing namespace entry is found and the formular gets an empty array.
The information stored in the instance is more like a 'marker' of this list. If there is a list with entries including the marker then this marker is preselected.

This is Alpaca JS stuff - maybe we could enhance it a bit.

Btw. to avoid such empty lists, you could add a 'noneLabel to this field with 'removeDefaultNone:false' if 'required:true'

@pz1
Copy link
Author

pz1 commented Feb 23, 2016

Misunderstanding I think!
With my remark "The sensor is not found there" I meant to say that the sensor missing in the arithmetic module wasn't found. The non-ZWAVE sensors were in the namespaces.

In the meantime I moved my cloned device to the other building. Everything seems to work.

The ZWave devices are now within reach. Also the arithmetic module now got its sensor parameters automatically as I expected.
So I hope I do have Backup/Restore pretty much working (though the procedure necessarily is a bit laborious).

@pz1
Copy link
Author

pz1 commented Feb 29, 2016

Is there a default folder where users should/could store their javascript files?
I am actually using the automation/storage folder for my UPD sender script. I have suggested storage in the past. but I don't think it has officially be sanctioned. For the final write up of backup/restore procedure I need an answer.

@ronie-z-wave
Copy link
Contributor

At the moment it is better to store them in automation/storage cause all contents will be stored in backup file and could be restored - providing they were registered in storageContent before and they were stored via saveObject() - it does the registering automatically ... otherwise it won't be recognized at the moment.

I'm not sure but I think saveObject()/loadObject() should handle saving / loading your .js ... Maybe you already do it in that way?

If this .js files are used in app it will be better to store them in MyModule folder - They then will be backuped during backing up modules (we're still working on it) in future.

@pz1
Copy link
Author

pz1 commented Feb 29, 2016

In my specific case it is a manually crafted javascript file that is run via the load javascript App. I don't think that App does register it.

jsfile

Is there a way to register it manually?

@ronie-z-wave
Copy link
Contributor

Not really, seems that it is one more topic for our todo list :)

but you can try the following:

  1. add the name of your .js file to automation/storage/storageContent-**.json (Array) - e.g. 'yourJSFile.js'
  2. make a md5 hash from 'yourJSFile.js' and store the following file with stripped file name -[a-ZA-Z0-9] - in your automation/storage folder - e.g. 'yourJSFilejs-77C741E3273C34918D1A7342D47F47CD.json', you could for example use this generator
  3. now it should be recognized during backup and also backup should be possible

I'm not sure but maybe it is necessary to transform the js file into one line string ... Otherwise it could work if you add the path to app only. Its try a worth, I'm exited :)

@pz1
Copy link
Author

pz1 commented Feb 29, 2016

That seems to be a bit too complex for a backup manual at the moment I'm afraid. We better go for the todo list.
Thanks anyhow for explaining this.

@ronie-z-wave
Copy link
Contributor

hmm, think best way is to have a automation/customCode folder (we already had since some weeks before) similar to automation/userModules that is not touched during updates and will be backuped, too.

@pz1
Copy link
Author

pz1 commented Feb 29, 2016

hmm, think best way is to have a automation/customCode folder

Seems a logical simple extension indeed. I'd rather call it userCode in analogy to userModule. (In the past customCode had a somewhat different context IIRC)

@pz1
Copy link
Author

pz1 commented Sep 18, 2016

Whatever

@pz1 pz1 closed this as completed Sep 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants