Catastrophic Nextcloud Upgrade
I neglected by Nextcloud installation so much that I found myself in 2024 running Ubuntu 18.04 LTS, PHP 7.2, and Nextcloud 20. All the upgrade windows came and went and I blissfully continued running an incredibly insecure installation. Last night I came to my senses and ran the do-release-upgrade command twice, from 18.04 to 20.04 and then to 22.04 LTS. Everything mostly worked like a charm and the server came back online.
When I tried to use Nextcloud though, it told me that I was completely out of luck because I was running a version of PHP that was too new. (8.1)
I looked around online to see if there was something I could do and a lot of the advice that I got was to downgrade my PHP version which is basically the last thing I ever want to do. The idea was to downgrade PHP, upgrade Nextcloud, and then upgrade PHP.
I also saw a bunch of people saying “just run it in Docker” and I wish I had. I tried, to be honest, but found both the “all in one” container and the docker-compose file to be so confusing. I was not able to get it to work.
In the end, I did what any desperate NUC user would do, and installed a fresh copy of Nextcloud while manually moving all of my files from the previous installation to their right location. I think this would be a complete nightmare for an installation of Nextcloud that has more than a handful of users in it, but for my purposes it did the trick.
This procedure was pretty painless. Be careful though, you may lose all of your stuff if you type in the wrong order, be sure to make a backup before doing this type of directory surgery.
# Remove the new files directory of your new installation
sudo rm $NEW_NEXTCLOUD_DATA_DIRECTORY/$USER/files
# If you are not sure where your Nextcloud Data Directory is,
# check out the /var/www/nextcloud/config/config.php file
sudo mv $OLD_NEXTCLOUD_DATA_DIRECTORY/$USER/files \
$NEW_NEXTCLOUD_DATA_DIRECTORY/$USER/files
# the occ utility is inside of your nextcloud installation,
# probably around /var/www/nextlcoud
sudo -u www-data php occ files:scan --all
This took quite a bit of time to run but in the end everything is in the right place and I am am happily running the latest and greatest version of Nextcloud.
Thank you for reading! Share your thoughts with me on bluesky, mastodon, or via email.
Check out some more stuff to read down below.
Most popular posts this month
- Great Lakes, Illinois
- Are we inside a Sarlacc?
- My Custom Miniflux CSS Theme
- Setting up ANTLR4 on Windows
- Vagrant Box for ROS2 on Apple Silicon
Recent Favorite Blog Posts
This is a collection of the last 8 posts that I bookmarked.
- Grow, Like a Tree Not a Cancer from Jim Nielsen’s Blog
- Pluralistic: All the books I reviewed in 2025 (02 Dec 2025) from Pluralistic: Daily links from Cory Doctorow
- DEP-18: A proposal for Git-based collaboration in Debian from Optimized by Otto
- [RIDGELINE] No Phones in The Ten-don Shop from Craig Mod — Writer + Photographer
- My next chapter with Mastodon from Mastodon Blog
- How many pillars of observability can you fit on the head of a pin? from charity.wtf
- The Software Essays that Shaped Me from Refactoring English
- Give Your Spouse the Gift of a Couple's Email Domain from mtlynch.io
Articles from blogs I follow around the net
Solving Advent of Code 2025 in Janet: Days 5–8
I’m solving the Advent of Code 2025 in Janet. After doing the last five years in Haskell, I wanted to learn a new language this year. I’ve been eyeing the “New Lisps”1 for a while now, and I decided to learn Janet. Janet is a Clojure like Lisp that can be …
via Programming Posts & Notes on abhinavsarkar.net December 13, 2025OpenAI are quietly adopting skills, now available in ChatGPT and Codex CLI
One of the things that most excited me about Anthropic's new Skills mechanism back in October is how easy it looked for other platforms to implement. A skill is just a folder with a Markdown file and some optional extra resources and scripts, so any L…
via Simon Willison's Weblog: Entries December 12, 2025Thoughts on Technological Purity
Thoughts on Technological Purity 2025-12-12 “Everything should be running on OpenBSD. My desktop, router, web server, and even minor local services should all be built on top of the great Pufferfish BSD.” I told myself this “mantra” not too long ago, after d…
via btxx.org RSS Feed December 12, 2025Generated by openring