I had OCIS running in an LXC on a proxmox install. There was a power outage and I don’t know what happened but the LXC wouldn’t start and it appeared to be fully empty when I looked for files. I know I should’ve made backups but you live and learn. The ocis.yaml for the original install is far gone with no hopes of recovery.
I still have my data folder intact on my hard drive array. Is there any way for me to recover those files? I was running 6.2.0 in an Ubuntu LXC.
If you only lost the ocis.yaml file: yes, there is a way. However it might not be very easy to do so.
If you are using external user management this can be done quite easy. You can just run ocis init again and then adjust the values for ldap bind password and system-user-id to match your ldap installation. After that you can just login normally with your users.
If you are using internal user management these values cannot be obtained easily. But you can still recover the files by extracting them manually from the blobstore. I have written a brief overview on how to this a while ago Issue Recovering Deleted Files in oCIS · Issue #6399 · owncloud/ocis · GitHub
1 Like
Ok so I actually did have a backup of the LXC. I have my full configuration back running 5.0.7 except I get an error when I try to run the server which is {"level":"error","service":"notifications","error":"mail: no address","time":"2025-05-23T01:55:14Z","message":"parsing error, the 'smtp_sender' must be a valid single RFC 5322 address."}. Do you know how I would resolve this?
Yes.
If you don’t use email notifications you can turn the notifications service off. OCIS_EXCLUDE_RUN_SERVICES=notifications
If you use email notifications you need to set the smtp-sender: NOTIFICATIONS_SMTP_SENDER="you <you@yourdomain.com>"
It’s been a lot of tinkering (I’m still a novice) but I found out that the ocis.yaml I recovered was from a different install. I’m back to square one without the correct ocis.yaml. I have the new install up and running and pointed at the old data but do not have the ldap bind password or the system-user-id. Would there be any way at all those could be recovered?
If you are not using an external user management, the password cannot be recovered unfortunately. You’ll probably have to extract the files manually from the blobstore as described above.
Maybe it would be a good addition to have a cli command that can recover files from the blobstore. But we currently don’t have it and it would need to be planned properly.
Why are you not advising to change the passwords in the IDM database? It seems rather natural to do so.
I resolved your situation properly! Hope this saves your instance. There are a few parts:
- In the IDM database, update service user passwords to known values. To do this:
- If you haven’t already, generate a new
ocis.yaml.
- Hashes your new service user passwords. There is supposed to be a tool specifically for this task, but I did it the worse way by initializing a new database:
- Start ocis server with an empty
idm directory (backing up your previous one), and let it initialize the database ocis.boltdb.
- Shut down ocis.
- Collect
ocis.boltdb from the previous instance, and the new password hashes. Use a BoltDB editor or binary editor (my choice) to replace the previous service account password hashes with the corresponding new hashes. The lengths of new and previous hashes are identical on my installation.
- Set the
system-user-id in ocis.yaml to the previous value, obtainable from storage/metadata/indexes/by-user-id/[ID].mpk (I have only one file under this directory).
- Some other service accounts need to fixed, too… I am currently seeing no sharing links nor invited people probably because of this. Or maybe because I am upgrading from 7.3 to 8.0?
Knowing its architecture, I probably won’t be using oCIS built-in IDM in the future… It is not pretty.