How updates work?
How updates work
I hope I don't get on your nerves with my amateur bungling ;-), when I create my own apps, which probably nobody needs at the moment. I just approach things autodidactically.
At the moment I have three working apps
Standalone MariaDB Server
MariaDB Server with Adminer
MariaDB server with phpMyAdmin
My next step would be to try Shopware.
This raises the question how updates actually work. I can't find anything in the Docs about this.
If I have successfully installed one of the apps and have set up appropriate databases, how do I keep them when I update?
The update pulls down the Docker image completely new and there it is written that he should create the folders first etc. (so in my case or is this thinking wrong?)
Translated by deepl.com
App updates are isolated to the app instances. So if a new app update is published (essentially a new docker image + maybe updated cloudronmanifest) then the old container is deleted and replaced with a new container from the new image. That new container will be setup and configured with the addons specified in the manifest. Addons are for example databases, see https://cloudron.io/documentation/custom-apps/addons/
But also a data folder, when
localstorageaddon is used will be mounted at
The app has to be packaged in a way to pickup the addon (eg database) credentials dynamically. Those may or may not change during app restarts.
This is one of the reasons we have addons in the first place. The platform can managed associated databases and knows how to backup and restore a database (postgres, mongo, mysql, .. all do it differently)
Now as far as I understand your case, you set out to package databases on your own and then maybe package other apps which will be setup to use those database instances. This however will break in various ways. One is the mentioned backup/restore. Think about an app update which fails midway during database/table migration. Now you want to restore to the previous version and thus also the database has to be restored properly as it might be in some unknown state. This is why those things have to be tied together. Another breakage could arise from the fact, that the database instance might be relocated to another domain, in which case the app has to be reconfigured/restarted automatically.
Generally if some other database engine is required, which is not available as an addon, then it has to be part of the app instance itself. This is a lot more trickier though if a backup of such a database requires code to be run to dump tables or such prior to a backup.
I hope I don't get on your nerves with my amateur bungling ;-),
Not a problem at all. In fact, I think it's helping us create valuable content and also helping us figure what kind of tutorials we need to create for new comers. Thanks and please don't hesitate to ask!
I think my question came out wrong. My question aimed to understand the different files in a package.
My first three apps was only a test, if I can package installable apps with easy configuration and thought Database server was relatively easy for me. Some beginning problems, but possible for me.
Now I would like to go up to next level and pack Shopware. A more complexity app.
Did you mean that Cloudron make a backup from all data, cleanup old version, install the new version and afterwards it restore the old Database to the new Version?
From the view of an app packages it can viewed as this. For practical purposes the platform skips a few steps to speed things up, but essentially yes the whole app data is saved, then everything torn down and then rebuilt with new version and old saved data.
This then just means that a regular app restore flow behaves the same way only with other saved data.