Nextcloud Memories and Syncthing for Photos

I am not sure whether this issue would be best posted in a Nextcloud forum, a Synchthing forum or here so if it is better elsewhere feel free to let me know and I will shift to a different forum.

I have Freedombox installed on a standalone PC with 10 T of file storage and 12 g of ram. I installed debian first on the box and then added freedombox. It has been running happily for several years.

On the server, Plinth says “You are running Debian GNU/Linux 13 (trixie) and FreedomBox version 26.8. FreedomBox is up to date.”

I have been using Nextcloud for a couple of years and now run the Memories photo app. I have more than 60,000 pictures stored.

I take several hundred images a month using a pixel 9a running grapheneos. The phone is kept up to date. The last time it updated was yesterday.

I have used the auto upload feature of nextcloud to copy photos and videos from my phone to my server. It mostly works but there are often days where some of the images on my phone do not transfer, sometimes as many as half of them. I haven’t been able to figure out why or how to make the auto upload copy all of the photos from the phone. When I look at the photos using the Nextcloud Memories app on the phone, I see all of the images on the phone. Those that are not transferred are identified by a crossed cloud icon. Stopping and restarting the file sync process or restarting the phone doesn’t trigger the transfer of the remaining photos. I end up copying them manually later in a batch and then have to go through a tedious process of picking out the ones that didn’t upload. This may be an issue with how I have it set up (I have struck out at finding how to fix that) but I have heard that others use syncthing as a solution for file synch of photos, perhaps because of this sort of problem.

Ideally, I could sync the /DCIM/Camera folder on my phone with a folder /P9aSynchthing that shows up as a folder in the Nextcloud app so that I can see the photos there and, as I move them out of that folder to my regular folder structure in Nextcloud or delete duds, Syncthing would see they are no longer in the /P9aSychthing folder and delete them from /DCIM/Camera on the phone.

Unless that is a bad idea, there are some things I need to sort out.

The first is that Syncthing puts the photos in a folder like /var/lib/syncthing/flrjc-365za with 0644 permissions. It has GUID and UID of syncthing. I don’t see a way to tell syncthing that I would like them to go directly to /nexcloud/P9aSyncthing or whatever that path would actually be for the folder P9aSyncthing I have set up in Nextcloud Memories. Would a symlink from the folder syncthing puts the photos in to the nextcloud folder be a solution or is there a way to get Syncthing to put the photos right into the nextcloud folder?

Would adding photos in this way mess up the database that nextcloud uses? I have copied a few test files into the folders nextcloud maintains and it shows them and lets me deal with them but maybe there is more to it than that.

Another is that some discussion on the Synchthing forum where others are using it to sync folders into other homelab type packages, permissions end up needing to be changed. I don’t know whether that would be an issue with Nextcloud in Freedombox or whether there is a way to set things up so that is sorted out automatically.

I don’t know whether it affects this process but I am travelling and do not have physical access to the freedombox server. I access it remotely.

Nextcloud has an External Storage app which I have installed in Nextcloud. These are some of the storage options it offers:

Local
FTP
WebDAV
Nextcloud
SFTP
SFTP with secret key login

I tried Local but the path /var/lib/syncthing/(folder name) came up with an error saying the folder did not exist which I assume is because it is outside the nextcloud container.

I am wondering whether one of the other options might work to access the files syncthing downloads into a folder outside the nextcloud container but haven’t used any of those before. . . .

I tried using syncthing and nextcloud to upload photos from a Pixel 8a running grapheneos, but I also could not get that to reliably work.

The least tedious solution might be to first tranfer your photos from one date, or a list of dates, to a laptop and let the laptop do the upload with nextcloud.

An alternative to USB for the transfer between the phone and the laptop is Share via HTTP | F-Droid - Free and Open Source Android App Repository. In Fossify Gallery | F-Droid - Dépôt d'applications pour Android libres et open source, it is possible to show photos by date (date followed by icons for all photos of that date) and long press on an icon (like first on one date) then long press on another icon below (like last one of one date), selects all of them, using the share icone (2 lines between 3 dots) I select the choice “share via HTTP” (need to be on the same local network).

If I connect the phone via USB and start a file explore, it usually takes a very long time to show the whole list, because I have so many photos in the same folder, while I don’t have that issue with this sharing via http.