[domoticz 2020.2] use existing database ... from ...

home automation

Moderator: Lillian.W@AST

Post Reply
User avatar
father.mande
Posts: 1810
youtube meble na wymiar Warszawa
Joined: Sat Sep 12, 2015 2:55 am
Location: La Rochelle (France)

[domoticz 2020.2] use existing database ... from ...

Post by father.mande »

Hi,

It's a response to a question directly receive in my mail (please post here, lot of others specialist (better than me) can help you)

Q. :
I saw on the Asustor App Central where you have placed your most recent Domoticz 2020.2.1 version.
I am updating from that updating from 4.11605.r1 maintained by “Patrick”, which is Docker based.

Can you give me a hint how to restore a database from that Domoticz version into your newer version?
Currently it does not work.

I was looking at the Forum (are your referring to the Asustor forum or the Domitcz forum???) as you mentioned it.
There you suggested some command lines in order to backup a database, probably for the older version.
Can tell me what to do to be able to enter these command lines? Is this using ssh on the Asustor?
R. :
I don't have any idea about Patrick delivery (it is online ... so you can ask it directly)
AS I said before, I will cancel my own delivery ... because (as for you) it's generating problems and versions adjustments ... so not for end user ... and Patrick is the best person to support you, I stop using (after years) Docker ... for a lot of security and hidden functions implemented in ... but it's a personal choice ... due to the fact that it's not difficult to do the same with chroot/pivot_root and namespace if more isolation is need ...
APKG with docker is delivered by one person ... even not responsible of the code in the container ... code delivered by another Hub ... coming from announced but not certified source ... from the original code (perhaps) ... for me it's lot of intermediate ... without full responsibility of the delivery. (I use docker but only for my own, build by me container, ... so when I know exactly what are inside and when by analyse I understand when docker interfere with the container.

For your question :
all settings are in a sqlite3 database name domoticz.db
... in my delivery it's in Ubuntu focal environment in /opt/domoticz
... do domoticz_mngt enter_in_ubuntu command to enter in Ubuntu and have new / for PATH name
extra plugins are in same folder in a directory name plugins

If you domoticz.db version is NOT newest than the domoticz ... normally compatibility is assumed ... the common mistake is to use a domoticz.db coming from a Beta version and move it to a stable version ... in this case domoticz said : "not compatible database" ... in this case update to new beta ... this can solve the problem (search an existing post about this point)

So if you have a domoticz.db from another system (or docker or what-else) ... the basic is to move this file to the new place (AFTER STOPPING domoticz) DON'T DO anything when domoticz run ...
... copy it in /usr/local/AppCentral/domoticz/focal_XXXXX/opt/domoticz ... XXXXX = x86_64 or armv7l or aarch64 depend of your NAS.
and restart domoticz

to save your settings ... you can use internal domoticz mechanism or use (for my version) : domoticz_mngt save_domoticz_data
... for detail use domoticz_mngt without argument to get help.

Philippe.
AS6602T / AS5202T /AS5002T / AS1002T / FS6706T
basmeyer
Posts: 13
Joined: Mon Jul 31, 2017 10:46 pm

Re: [domoticz 2020.2] use existing database ... from ...

Post by basmeyer »

Thank you for your instructions, Philippe

To make it simple for myself and perhaps this is helpful for some others that want a step by step instruction of what I did:

I made sure on the Asustor in ADM > Services > Terminal SSH was on and SFTP also, but not EZ Connect as this disrupts proper access.
I made a database backup within the previous Docker based Domoticz the usual way to the Downloads folder.
Like you said I then stopped all Domoticz apps within the App Central.
Then with FileZilla on the Mac I created a connection (with all the proper settings), opened the folder like you mentioned, so in my case because I have a AS6202T I went on the Remote Site (so the NAS) to /volume1/.@plugins/AppCentral/domoticz/focal_x86_64/opt/domoticz and I renamed the existing domoticz.db to domoticz_default.db and dragged and dropped domoticz.db from the Downloads folder (Local site or directly from the Finder) to this location. And of course made sure it was called like this, so in my case had to rename it so no capital D but a small d instead.
It was now time to turn on your 2020.2 Domoticz in the App Central and after that, because from past experience that the OpenZWave USB dongle likes a cold start, I did a shutdown of the NAS and after completion I turned it back on again.

And... success! Everything seems to work properly in the new Domoticz!

P.S. I did perform domoticz_mngt enter_in_ubuntu within /opt/domoticz during a ssh session and logged in with Terminal and ssh (username)@(ip-address-of-nas) after turning off the Domoticz apps but I am not sure if this was needed or not... (?)

Thanks again and looking forward to using this newest version!
Will report my findings on viewtopic.php?f=166&t=11134 if any.
Post Reply

Return to “Domoticz”