Upgrading OS on nextcloud server

Nextcloud version (eg, 20.0.5): 21.0.4
Operating system and version (eg, Ubuntu 20.04): Debian 10 buster
Apache or nginx version (eg, Apache 2.4.25): Nginx 1.14.2
PHP version (eg, 7.4): 7.3

The issue you are facing:

I have a perfectly working Nextcloud server. I just want to upgrade the OS of the server from Debian 10 to 11; however, I am afraid that this would break my Nextcloud instance. Debian 11 comes with Postgresql 11, PHP 7.4 and Nginx 1.18.0. What is the best way to handle this process in the most graceful way? It feels to me that any of these upgrades, even without upgrading the OS can easily break Nextcloud. Is it more feasible to just reinstall Nextcloud instead? If so, is there a list of config files, database directories, etc. that need to be carried over? Please excuse my ignorance, I would really appreciate any pointers.

I did upgrade with Ubuntu 16-18-20 and did not meet any trouble, besides to reconfigure some defaults after upgrade. Nextcloud works good with PHP 7.4.
I suppose you have to perform Backup, especially of DB and be ready to Restore in case of trouble, but this has lower probability.

1 Like

Backup is essential. OS upgrade depend a bit on the OS and how well they can keep certain configurations. Especially when major versions of packages are changing and you have dependencies, it can be a bit tricky and you need to plan some time. What we have seen often on Debian/Ubuntu was that if the php version changes, you have to go through the php settings, some required packages are not installed. Normally, these are just a few points and you don’t have to go through a completely new setup.

2 Likes

In addition what already has been said. You could also use the official PHP and Postgresql repos instead of the Debian packages. Then you can manage PHP and Postgresql versions independently of the versions provided by the Debian stable repos.

@hakayova If you are not familiar with Debian, then better leave it alone. Use only the standard repositories. And please make a backup and be familiar with restore procedure. And has already been told that you should make a backup. :wink:

2 Likes

@devnull
Yes I probably should have added that to my comment.

@hakayova
And yes, you should definitely make backups before updating to new major versions of the packages involved. Especially when it comes to databases.

2 Likes

Thank you all so very much for taking time to help with insightful comments. Since this will also involve upgrading the database from PSQL 11 to 13, as well as PHP (and its modules) I am a little nervous about the process but I think I can do it with a little time investment, appropriate backups as mentioned and some sweat and hopefully no tears :blush:. My nextcloud setup is in a local VM, which is backed up daily, so the worst case scenario would be falling back to what is currently working, if everything else fails I suppose. Thank you again so much for the guidance, links and encouragement!

I am here to report that my upgrade went mostly smoothly. As mentioned, I had to install some php modules manually and transfer some config settings mostly for php. It took a couple of hours, but everything is working well right now. Thank you all so much for your help!

3 Likes

Lucky you. I’ve done the same on a hosted NextCloud image, also Debian Buster to Debian Bullseye, and my server’s been down for two weeks now. To make matters worse, the hosting support team won’t answer my ticket.

What the heck is a hosted Nextcloud Image? A cloud server (VPS) with a preinstalled Nextcloud on it? A managed Nextcloud instance, where you have root access to the underlying OS? Or maybe it’s just a generic €1.99/month Debian VPS on which you installed Netxloud yourself copy & pasting some random tutorial or worst case with some random script…?

Indeed. It’s a preconfigured Nextcloud VPS image provided by the hosting platform.

The rest of your wild assumptions are merely that: wild assumptions. Fun to read, but hardly applicable to my situation. :slight_smile:

If that’s the case I would have pulled my files and would have moved on. I mean no response in two weeks? And yes it was probably not a good idea to upgrade the OS on a preconfigured system, without contacting the hoster or knowing the exact configuartion of the components used, but they should at least have given you some answer by now. If it were a manual installation you copy & pasted from some random tutorial, it would actualy be better, at least we would have some documentation how everything was installed and therefore could possibly help you.

Anyways. Sorry if my post came across a bit cynical. Partly it was :wink: …but I also had the intention to help, if it were possible. But in this case it is probably best to pull the data, re-install it or move on to another provider. If there is documentation for this installation, perhaps you could post it here, maybe someone is able to help…

For me the Update also went smoothly, but:

  • redis-server package is updated from 5.0.3 (buster) to 6.0.15 (bullseye)
  • configuration in config/config.php was from the docs
  • this config didn’t work anymore, had to comment out ‘password’-section → probably it wasn’t used before and now it’s not possible to connect!? (since it’s local anyway, I think it’s not necessary)

Does anybody know why it worked before without stating ‘password’ in redis-config?

To use password, one has to adjust /etc/redis/redis.conf here (comment out this line, change ‘passwordtouse’, same ‘passwordtouse’ in NC-config):

#requirepass passwordtouse

I’m starting to come to that same conclusion. Did some further digging, turns out it’s using Turnkey Linux, which apparently hasn’t moved to Bullseye yet. Since I haven’t got a clue how that stuff is configured, or how that image differs from a regular Debian, it’s proving to be a bit of an adventure. That’s what I get for going against my better judgement, and trying the “preinstalled appliance” route rather than rolling my own, like I normally do. :man_shrugging:

And you’re right. I should strongly consider moving on. Only reason I’m staying for now is because I got a pretty beefy VPS at half the regular price due to ${historical_reasons}. They used to be more responsive, so no clue what’s going on. Staffing issues? About to go out of business? No clue, but yeah, I’m downloading my data just in case.