< 152025-01-16⋎17 >

Topic for #farmOS is: farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Forum: farmOS.discourse.groupSet by mstenta on 2021-06-15 at 12:52
00:02mstenta[m]Ok so... actually the image update did work!
00:02mstenta[m]I can tell by PHP 8.3
00:03mstenta[m](It worked before too)
00:03mstenta[m]But... there is another consideration (the second possibility I mentioned above, after all)
00:04mstenta[m]Because you are mounting the entire /opt/drupal directory as a volume... that is the whole farmOS codebase (including Drupal core)
00:14mstenta[m]The "development environment" documentation on farmOS.org recommends mounting /opt/drupal, so that you can load everything into an IDE
00:14mstenta[m]So my first question is: is that your intention?
00:14mstenta[m]To do development?
00:15mstenta[m]If so, then updating the farmOS codebase is more involved than just pulling a new image
07:10postmanpat[m]Aha.. I kind a suspected this, so tried to change the volume to ...web/sites. Then I got some errors about wrong config files.
07:11postmanpat[m]<mstenta[m]> "So my first question is: is that..." <- No, I don't need that
07:13postmanpat[m]This is BTW the same case with my procduction stack.
07:13postmanpat[m]The dev image was the first farmOS I managed to run, so went from there.
12:39postmanpat[m]I fooled around a bit today on the dev-stack. Trying to fix my volume mounting. I was aware it could break things, but it's okay this case.... (full message at <matrix.org/oftc/media/v1/media/download/>)
12:40mstenta[m]Good morning postmanpat! It seems we are on the same schedule 😆
12:40mstenta[m]Great! Well at least we know how to solve it :-)
12:41mstenta[m]Curious what broke when you changed the volume mount
12:41postmanpat[m]Haha..... (full message at <matrix.org/oftc/media/v1/media/download/>)
12:42mstenta[m]You'll have to make sure the directory you mount into /opt/drupal/web/sites is ONLY the sites directory
12:42postmanpat[m]mstenta[m]: Yea, me too. I did some bad volume mounts and that propably made things worse.
12:42mstenta[m]So eg, if you were doing - './farmos-www:/opt/drupal', then it would become - './farmos-www/web/sites:/opt/drupal/web/sites'
12:42mstenta[m](adding web/sites to both sides)
12:43mstenta[m]But ultimately, you don't need everything else in ./farmos-www, so you might want to just move www/sites out of that, and then just have `- './sites:/opt/drupal/web/sites'
12:43postmanpat[m]Ok. and then everything should work out of the box?
12:43mstenta[m](or something like that)
12:43mstenta[m]* But ultimately, you don't need everything else in ./farmos-www, so you might want to just move www/sites out of that, and then just have `- './sites:/opt/drupal/web/sites'`
12:43mstenta[m]Should
12:43mstenta[m]:-)
12:44mstenta[m]But since you are also presumably upgrading farmOS at the same time, be sure to also run update.php, clear cache, etc
12:44postmanpat[m]If it messes up, it's the sites backup that needs restore right?
12:45mstenta[m]In theory nothing will get changed in the sites directory if something gets messed up. More likely that something breaks in the database, so that's what would need restore.
12:46mstenta[m]The database has a lot of state and the structure of it needs to match the codebase
12:46mstenta[m]So if you update the codebase, and the database doesn't get updated accordingly (if it need to), then things can break
12:47mstenta[m]But the sites directory just contains settings.php (with db credentials) and uploaded files, mostly, so not much will break in there (it also includes cached CSS and JS, but clearing the cache wipes those)
12:49postmanpat[m]<mstenta[m]> "But ultimately, you don't need..." <- Not sure if I got that.. please specify if the paths are docer-side og on the volume
12:59mstenta[m]./farmos-www is a directory on your host
12:59mstenta[m]./opt/drupal is the directory inside the Docker container
13:00mstenta[m]when you bind-mount a volume, it makes everything that is in ./farmos-www appear inside the docker container in ./opt/drupal
13:00mstenta[m]/opt/drupal is meant to be the entire Drupal/farmOS codebase, and /opt/drupal/web/sites is just the stateful files like settings.php and uploaded photos
13:02mstenta[m]So if you started with ./farmos-www:/opt/drupal as your volume config, then your local ./farmos-www folder will contain the whole Drupal/farmOS codebase
13:02mstenta[m]But if you are switching to only mounting the sites directory, you don't need to have any of the Drupal/farmOS codebase in a local directory
13:02mstenta[m]You only need sites
13:03mstenta[m]So what I would probably do is:
13:03mstenta[m]`mv ./farmos-www/web/sites ./farmos-sites`
13:03mstenta[m]Then mount ./farmos-sites:/opt/drupal/web/sites
13:03mstenta[m]And delete ./farmos-www
13:03mstenta[m]Make sense?
13:11postmanpat[m]Indeed. Thanks 🙏
16:19*aathiappan has joined
16:21*aathiappan has quit
16:57symbioquine[m]farmOS dev call starts in a few minutes! All are welcome! meet.jit.si/farmos-dev
23:38postmanpat[m]<mstenta[m]> "Make sense?" <- I moved this to the [forum](farmos.discourse.group/t/farmos-will-not) to document the process. I've cloned the production environment, and can test the change of volum mounting. It looks similar to what happened to my dev environment.
23:38postmanpat[m]Right now I have a missing document module to put me to sleep. Don't think it's the farm_document module I'm missing.

< 152025-01-16⋏17 >