More articles:
2017   2018   2019   2020   2021
2022   2023   2024   

2020-11-10 00:00:00

Technologycommand line|guide|how to|linux|maintenance|nextcloud|step by step|stuck|update|upgrade

Manual upgrade to Nextcloud version 20, 21 and 22

Update 2021-04-12: Nextcloud upgrade tested also from version 20 to version 21.
Update 2021-07-10: upgrade to version 22 was a challenge, but problems were solved. See below.

Our Nextcloud system is small but it is a vital resource for us. We have always updated the software as soon as new major and minor versions have been released. So far, updates have been easy. The Updater that runs in browser has done all the work. Unfortunately, this is not the case anymore. Upgrade from version 19.0.4 to 20.0.1 failed completely. So, we decided to dive into the manual update process. Here is what we learned: instructions for updating Nextcloud using the Linux command line.

Depending on your version of PHP, or web server software your upgrade may behave slightly differently. Our Nextcloud is running on Debian 10, Apache 2.4, Mysql/Mariadb 10.3, and PHP 7.3. These instructions are based on that system configuration.

Step by step upgrade guide for Nextcloud (command line)

Backup the Nextcloud database.
We also backed up the dataand configdirectories located under the main Nextcloud directory.

Download the release of Nextcloud you want to upgrade.

Turn Maintenance mode on for the Nextcloud server. www-data is the user name Apache server uses, other web servers and Linux distributions may have other names, so change the name accordingly.
sudo -u www-data php occ maintenance:mode --on

Tip: go to the directory where occ command is - it should be in the main Nextcloud directory. If occ refuses to run, try:
sudo -u www-data php ./occ maintenance:mode --on

Unzip the zip file or unpack the tar package into the current Nextcloud directory. Note: the previous version is replaced with the new one - you should save the old version first if you want to keep it.
unzip nextcloud-n.n.n.zip
or
tar -xjf nextcloud-n.n.n.tar.bz2

If you copy the new version over the old from your PC using a FTP program, ensure all the directories and files under your nextcloud main directory are owned by the web server user (for Apache2, it is www-data):

chown -R www-data *

Run the upgrade program:
sudo -u www-data php occ upgrade

If the upgrade was successful, turn off Maintenance mode:
sudo -u www-data php occ maintenance:mode --off

Multiple steps longer, more detailed upgrade guide with a few troubleshooting tips is available in the Admin manual.

nextcloud upgrade in linux command line

Upgrade from version 20 to 21

Upgrade from version 20.0.8 to version 21.0.1 worked without problems in our system. New system warnings appeared after the upgrade, so it is important to view the Settings - Administration/Overview for information.

Upgrade from Nextcloud 21 to 22

A word of caution: after running Nextcloud 22 for two weeks, it has become painfully clear that version 22.0.0 is not ready for daily production use. The upgrade has its problems, but risks with apps that don't work with version 22.0 are more serious. For instance, incompatibility with two-factor authentication may prevent login to the system.

On our system, the upgrade from Nextcloud 21 to version 22 was a time-consuming project because of two nasty problems. The manual upgrade process went through without any problems. The log didn't include error or warning messages.

nextcloud 22 update in web browser

When I tried to open Nextcloud in a web browser, it displayed a message that told me to run Update. There were no other choices, so I clicked the Update button. The Update ran, and again, the log was clean: no errors. Then, the same Update button appeared again, requesting me to run Update. It was an endless loop.

Where and how to start problem-solving without any clues? The Update button said it wants to upgrade files_sharing app and disable twofactor_nextcloud_notification app (although the log indicated they had been done). As I browsed the apps directory, I noticed new directories and files. They were not owned by the web server user that is www-data for Apache2. The command:

chown -R www-data *

Assigns all files and directories recursively to www-data. But still, the web user interface insisted on updating the software, referring to files_sharing app. Perhaps there is a way to update the app on the command line? Yes, there is. Update didn't work, but disabling the app is possible as well:

sudo -u www-data php occ app:disable files_sharing

That was it! File sharing feature is now disabled, but the version 22 works.

Verify the upgraded system

Especially, upgrading a major version can cause side-effects. Nextcloud 20 seems to have a number of them, so take a little time to check a few things after the update.

Go to the admin panel (Settings - Administration/Overview). If you have the following error message:

  • "Some app directories are owned by a different user than the web server one. This may be the case if apps have been installed manually. Check the permissions of the following app directories:
    nextcloud/apps/dashboard
    nextcloud/apps/user_status
  • The solution: change the owner of the directory and its files. Here again, www-data is the user name of the web server:
    chown -R www-data dashboard
    chown -R www-data user_status

Admin panel (Settings, Administration/Overview) may list warnings that refer to database fields, like:

occ db:convert-filecache-bigint
occ db:add-missing-indices
occ db:add-missing-primary-keys

The complete command to run is:

sudo -u www-data php ./occ db:convert-filecache-bigint
sudo -u www-data php ./occ db:add-missing-indices
sudo -u www-data occ db:add-missing-primary-keys

Another error message:

  • "Some files have not passed the integrity check. Further information on how to resolve this issue can be found in the documentation. (List of invalid files… / Rescan…)"
  • In our case, the problem was apps installed during the previous version of Nextcloud. The integrity check displayed them as Extra Files.
  • The solution: We did nothing because the apps will be installed when they are available for version 20.

When you check the apps available in your Nextcloud installation, you may find out that many apps have been disabled in the new version.

  • The solution: There is no other choice than to wait for updates for the apps.

Browser based Updater failed with version 20

We started the upgrade to Nextcloud 20 in the browser based updater program. It failed. It stopped in an ambiguous error message that hinted at problems in the integrity of the package.

A few attempts later, the Updater was stuck in Maintenance mode, and the entire system was unusable.

A number of similar error descriptions on the community forum indicated that this wasn't a trivial problem to solve. And it wasn't. After we had spent too much time on it, we decided to try the command line update - and it worked like a charm.

News

2026-02-08 15:26:00

As a whole, it was a delightful trip to the visitor-friendly city. Here are the highlights of the Montpellier city center. #travel #Europe #Francehttps://klaava.com/city-break-in-the-pretty-and-friendly-montpellier-in-southern-france/


News

2026-01-27 15:27:00

Judged anonymously by an international panel, the 2025 TPOTY shortlist was selected from more than 20,000 entries across 160 countries, making this one of the most competitive #travel #photography competitions in the world.https://www.digitalcameraworld.com/photography/awards-and-competitions/the-worlds-best-travel-photographs-are-crowned-and-the-winning-images-are-simply-stunning


News

2026-01-22 17:33:00

A survey revealed the level of trust people have in their fellow citizens in 90 countries across the world. Here is the top 50 countries where people trust in other people the most. #travel #safety .https://klaava.com/when-traveling-do-you-trust-people-overseas-here-is-how-much-locals-across-the-world-trust-their-fellow-citizens/


Evening in the historic center of Montpellier.

2026-01-21 16:00:50

arihak

Evening in the historic center of Montpellier.


News

2026-01-08 15:26:00

While residents’ concern about masstourism in some countries in #Europe is real, where do Europeans themselves #travel when they want to enjoy a week-long break? .https://klaava.com/where-europeans-like-to-travel-for-one-week-holiday-in-the-eu-region/


Statues guarding a castle in Copenhagen.

2026-01-07 17:08:46

Statues guarding a castle in Copenhagen.


Wide open Atlantic Ocean

2026-01-04 12:50:32

arihak

Wide open Atlantic Ocean


News

2025-12-26 14:41:00

If we look at the millions of tourists who will travel somewhere they haven’t visited before, we can discover trends that are gradually changing how and where we travel. Here is our take on #travel #trends for #2026 .https://klaava.com/travel-trends-2026-road-trips-calm-and-quiet-ai-assistants-and-popular-culture/


Just in case you forgot to bring your own #book to the port

2025-12-24 17:12:21

arihak

Just in case you forgot to bring your own#book to the port


News

2025-12-24 08:24:00

I downloaded a #phone app with a “zero-processing” feature that claimed to take photos without any software alterations. When comparing the photos my phone #camera takes automatically to the photos taken with this app, the results were shocking. #photography .https://www.theguardian.com/commentisfree/2025/dec/23/smartphones-photos-filters-pictures-software


News

2025-12-16 08:59:00

9 professional #cyclists produced enough power on pedals for an ultralight airplane to take off in Mallorca.https://elpais.com/deportes/ciclismo/2025-12-15/las-alas-de-red-bull-como-nueve-ciclistas-despegan-un-ultraligero-con-sus-pedales.html


News

2025-12-11 16:33:00

Person of the Year focuses world’s attention on the people that shape our lives, TIME editor-in-chief Sam Jacobs wrote. “this year, no one had a greater impact than the individuals who imagined, designed, and built #AI.”--- ok, but is the Editor a person or AI?https://www.euronews.com/culture/2025/12/11/time-person-of-the-year-2025-announced-the-architects-of-ai


News

2025-12-10 08:31:00

Here is the index for the top 30 cities in the world for moving around on a #bicycle. #travel .https://klaava.com/if-you-like-to-explore-cities-you-visit-by-bicycle-here-are-the-best-destinations/


Nice quiet morning, but do scooter manufacturers know about electric vehicles?

2025-12-04 17:49:27

arihak

Nice quiet morning, but do scooter manufacturers know about electric vehicles?


News

2025-12-04 16:40:00

Data from the world's leading hotel groups, travel firms and trend forecasters suggests that 2026 will be the year of quiet escapes, algorithm-shaped itineraries, ultra-personalised retreats and a return to slower, more intentional #travel.https://www.bbc.com/travel/article/20251201-seven-travel-trends-that-will-define-2026


News

2025-12-01 11:01:00

It’s not the tool that matters, but the mind behind it. Perhaps the real question for any #photographer today is not what technology can do next, but what remains worth doing by hand—what still carries the trace of human attention.https://fstoppers.com/opinion/how-photographers-made-themselves-replaceable-714901


News

2025-11-24 11:23:00

It is possible to do a day trip from Madrid, for instance, to Segovia or Avila, or plan a tour that covers all four cities. #Europe #travel .https://klaava.com/four-cities-near-madrid-that-give-visitors-a-taste-of-the-real-spain/


Going down fast.

2025-11-22 16:00:12

arihak

Going down fast.


News

2025-11-16 17:19:00

Confirmed, the peak #travel season in #Europe is longer:“Normally we expect some traffic until the first week of October and then a slow fading until early November, but it has been nonstop.” It was, he says, the busiest October he has ever known.https://edition.cnn.com/2025/11/15/travel/europe-tourism-fall-peak-season


News

2025-11-10 11:33:00

Everything was fine until the Halloween weekend when our journey turned into a nightmare. Suddenly, I couldn’t charge the van from public chargers anymore. #EV #chargerhttps://klaava.com/nitpickers-travel-journal-bank-meddled-with-ev-charging-payments-causing-us-a-halloween-nightmare/


More articles:
2017   2018   2019   2020   2021
2022   2023   2024