
How I Survived a Nextcloud Update Disaster – Restoring From Backup.
Ever had one of those moments when you think, “Hey, today’s the day I’ll update my Nextcloud instance!”? Yeah, that was me, this past Sunday. What could go wrong, right? After all, the update tool said everything was good to go. But in reality, things could not be farther from the truth.
How Did We Get Here?
It started like any innocent afternoon: a cup of coffee, a quiet Sunday, and the decision to finally update Nextcloud to version 28.0.9. This is where I messed up!
I clicked on the install now button fully expecting the self-update tool to fail as it always had before, but to my amazement, it completed without throwing any immediate errors. Okay, I thought, let’s refresh the instance and log back in. That is when I was greeted with the infamous Internal Server Error 500. F*ckkkkkk.

The Road to Recovery
Luckily, I was able to recover Nextcloud from my Kopia backups. If you haven’t tried Kopia yet, it’s worth checking out. The software is fast, easy to use, and (most importantly) it actually works. In my moment of panic, it was my saving grace.
Here’s how I restored my Nextcloud instance:
- Stop All Nextcloud Services
- Before diving into the restoration, I needed to stop all Nextcloud-related services. This prevents any conflicts while restoring from the backup.
sudo systemctl stop apache2
sudo systemctl stop mysql # (if you use another db, replace mysql)
sudo systemctl stop redis
- Restore Critical Directories from Backup
- Next, I restored the essential directories (
/etc
and/var
) from my Kopia backup. While this method worked for me, there might be more elegant solutions, so feel free to share your thoughts in the comments. - Directories to restore:
- /var
- /etc
- Next, I restored the essential directories (
If you’re using Kopia, the restore process is simple. Just use the command or GUI to navigate to these directories and overwrite the old files with the backed-up versions.
- Start All Nextcloud Services
- Once the directories were restored, I restarted the Nextcloud services in the following order. The order matters, so follow this sequence:
# Start Redis first
sudo systemctl start redis
# Start MySQL (if you use another db, replace mysql)
sudo systemctl start mysql
# Start Apache2 (last)
sudo systemctl start apache2
Crossing Fingers – Starting Up Again
Once the files were in place, I took a deep breath and restarted all Nextcloud services. Imagine me, hands shaking on the keyboard, typing systemctl start apache2
. After a few tense seconds… boom, Nextcloud was back. 🛠️
The login page appeared, and I was finally back inside. I sat back for a moment, feeling triumphant, like I had just crossed the finish line after a grueling marathon. But, of course, that wasn’t the end… 🙁
Fixing the Errors – The Integrity Check Scare

No sooner had I logged into Nextcloud than I was greeted by another nightmare: “Some files have not passed the integrity check”. Perfect. As if restoring from a backup wasn’t stressful enough, now I had to deal with this. It’s like Nextcloud was trolling me at this point.
This integrity check error meant some files were either corrupted or missing, and Nextcloud wasn’t happy about it. I tried to laugh it off, but deep down I knew I had more work to do. So, with the page mocking me, I fired up Google and started searching for solutions.
The Savior – Ernolf’s Script

After what felt like an eternity of sifting through forums, blog posts, and endless documentation, I stumbled across Ernolf’s legendary post on the Nextcloud forums. Hidden in the vast sea of troubleshooting guides, there it was: a script that could save me from my integrity check nightmare.
The script we are focusing on is the nc-integrity-fix script which comes from EBTB (Ernolfs bash toolbox), a collection of scripts designed specifically for Nextcloud admins. Huge Shoutout to Ernolf for developing such a comprehensive toolbox for the community. Without this, I was about two steps away from tossing my server out the window.
After investigating all of Ernolf’s code, I felt confident in the functionality of the code and finally downloaded it to my Nextcloud server. With a mix of nervousness and excitement, I ran nc-integrity-fix and the terminal started prompting me to approve fixes.
I had a mix of extra files and files with incorrect hashes, all of which were swiftly corrected by Ernolf’s tool. I was especially surprised by its ability to detect files with incorrect hashes and download them from Nextcloud’s GitHub page. Needless to say, this patched up all of my errors and I am back to where I started. No more updates for me!
Lessons Learned
- Always have backups. Seriously, Kopia (or an alternative backup tool) can be your best friend.
- Don’t trust an update just because it says it worked.
- Keep a cool head and dive into the forums—there’s always a hidden gem of a solution out there.
Comment and Share Your Tips
Have you been in this situation before? Or have a better method for restoring Nextcloud? Comment below and let me know! I’m always eager to learn better, less heart-attack-inducing methods of solving these headaches.
Leave a Reply
You must be logged in to post a comment.