Thanks @p.konetskiy and @pgr for the fast reply and detailed info.
Regarding config_override.php
is this file generated by the installer and necessary for a restore or would this be a config file I provided that obviously I would need a copy of?
@pgr It does sound quite messy as it seems there is a lot of generated/necessary “state” files mixed in with the base application (in addition to the UGC uploads)…not very well defined exactly where the important “state” files are…
-
upload
but not upload/upgrades
-
custom
but not QR&R files
-
modules
…some things…not clear which because some studio/module builders create things here instead of in custom/modules
It would clean things up quite a bit if all user and system generated (modules) content was able to be segmented off into a configurable DATA_DIR
and CACHE_DIR
to make “clean” deployments easier. CACHE_DIR
could be used for any caching, update files, etc and is not necessary for backups/restore but partitions off that type of data from both the APP_DIR
and DATA_DIR
s.
The way we normally do this is by passing env with the relevant directory locations to the app when it is run. Of course we take care of creating the directories and making sure the app’s user has appropriate access/perms. In the php case we aren’t running an app but the webserver hands php files off to a “plugin” for processing (why we don’t need execute permission on the php files)… so it would need to be specified with config file for the php app instead…but should still be possible I would think without too much issue. Default directory location(s) could live in the APP_DIR
root of course.
I understand your point about the git approach. I will keep that in mind as an option.
Generally I try to do the following:
- only backup “state” and not application code. state includes database and “DATA_DIR” stuff.
- backups contain current version of application code
Restores always restore with a fresh install of the same version of the application as the backup was made from to avoid data schema migration problems.
Restore just involves deploy of:
- fresh application code (same version of app as backup)
- database
- DATA_DIR
- config file(s)
This approach allows users to customize all they want because any “state” is either in the db or DATA_DIR and both are backed up and easily restorable.
Backups are well defined and restores can be done with “clean” application code…ie if your server gets hacked you know you are restoring with clean application code on the rebuild (plus the backed-up state).
Maintaining (pulling in changes) and deploying form our own git fork doesn’t really solve the problem for me because I don’t want to maintain state for a specific deployment in git with the application code…for instance if I want to deploy both staging and production from the same code-base and have different “state” for each.
But okay, that is the status quo and the exact info I was looking for. Just a bit disappointed that it is so complicated to extract the state for backup from the rest of the application code.