Is there a command line to update to specific versions of Nextcloud?

Nextcloud hosted on Truenas

I currently have version 25.0.3.2 and am trying to update to the latest version, 27.1.4, but with every attempt using the web and command line to update, I get an error stating that there can’t be major upgrades and downgrades…My strategy is to update to each new build one by one until I reach the latest.

Is there a command line /occ upgrade for a specific build?
Is there a work around this issue?
Is there way to upload a installation file into the shell?

You can’t skip major versions. You can use the command-line updater:

sudo -u www-data php updater/updater.phar

This looks, downloads and extracts the code of the new version. In the end, it asks you if you want to execute the occ upgrade command which eventually runs the update itself. It should respect the supported upgrade path.

That is true on plain setup. If there is something in the background for the packaging, the upgrade path might be different and you have to go through the package manager of what you are using.

Hi @tflidd ,

I need to update Nextcloud from 25.0.2 to the latest version. I understand I must update incrementally through all the versions. However, while doing the research to update from 25.0.2 to the latest version it seems the Nextcloud manual and what you suggest differ.

You suggest: sudo -u www-data php updater/updater.phar, will update to the next proper update. So one could move along the update path incrementally by repeating the command until the latest version is reached.

However, the manual ** Upgrade manually — Nextcloud latest Administration Manual latest documentation ** has a very different process to update incrementally. The manual says to " … Download and unpack the latest Nextcloud Server release (Archive file) from nextcloud.com/install/ into an empty directory outside of your current installation, … etc .

Which is the proper way to update incrementally?

Thanks!

There is a difference between updating manually (the docs you linked to) versus updating using the Updater in command line mode:

https://docs.nextcloud.com/server/latest/admin_manual/maintenance/update.html#using-the-command-line-based-updater

Thanks @jtr

I seems like it. But does the Updater in command line mode update incrementally? So starting with version 25.0.2, I would repeat the Updater in command line mode until reaching the the latest version?

That is correct.

Thanks! I’ll start the Updater in command line mode and let you know how it goes!

1 Like

Does the Web-base Updater update incrementally? So starting with version 25.0.2, I would repeat the Web-base Updater until reaching the the latest version?

Yes. I think so.

@jtr
@devnull

My current version is 25.0.2. The Updater in command line mode or Web based mode is offering version 25.0.13.

I was expecting an incremental version up from 25.0.2.

Is there a flag or option to set which would update incrementally?
Any suggestions?

Thanks!

Update is first to latest release of actual release. For you Nextcloud 25.0.13.

Maintenance and Release Schedule · nextcloud/server Wiki · GitHub

My current version is 25.0.2. The Updater in “command line” mode and “web based” mode is offering version 25.0.13 to update too.

Can I update from my current version of 25.0.2 to version 25.0.13 which is being offered by the updaters?

Yes. And after that you get the update to the latest Nextcloud 26.

1 Like

I got it now. Thanks for your patience! I appreciate you.

I updated from 25.0.3 to 28.0.3

The update went OK until version 28.03. Any advice is welcomed.

I tried running occ db:add-missing-indices which returned: occ not found. I noticed file ownership is root:root.

I also noticed the following files in nextcloud/config …
-rw-r–r-- root root 0 Mar 11 2020 CAN_INSTALL
-rw-r–r-- root root 54131 Mar 11 2020 config.sample.php

… but not config.php.

Well after some time all the files in nextcloud/config have appeared and the file ownership is correct www-data www-data and config.php is there also.

There is the error message:

Security & setup warnings

It’s important for the security and performance of your instance that everything is configured correctly. To help you with that we are doing some automatic checks. Please see the linked documentation for more information.

There are some errors regarding your setup.

  • Some files have not passed the integrity check. List of invalid files… Rescan… For more details see the documentation :arrow_upper_right:.

  • 226 errors in the logs since March 17, 2024

  • Server has no maintenance window start time configured. This means resource intensive daily background jobs will also be executed during your main usage time. We recommend to set it to a time of low usage, so users are less impacted by the load caused from these heavy tasks. For more details see the documentation :arrow_upper_right:.

  • The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running “occ db:add-missing-indices” those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster. Missing optional index “textstep_session” in table “text_steps”. Missing optional index “fs_parent” in table “filecache”. Missing optional index “mounts_user_root_path_index” in table “mounts”. Missing optional index “systag_by_tagid” in table “systemtag_object_mapping”.

  • The PHP OPcache module is not properly configured. The OPcache interned strings buffer is nearly full. To assure that repeating strings can be effectively cached, it is recommended to apply “opcache.interned_strings_buffer” to your PHP configuration with a value higher than “8”… For more details see the documentation :arrow_upper_right:.

  • The database is used for transactional file locking. To enhance performance, please configure memcache, if available. For more details see the documentation :arrow_upper_right:.

Please double check the installation guides :arrow_upper_right:, and check for any errors or warnings in the log.

Check the security of your Nextcloud over our security scan :arrow_upper_right:.

Watch the list. Mostly you must only delete the files.

Not really interesting. Maybe read the errors in the protocol.

documentation

sudo -u www-data php /path/to/nextcloud/occ db:add-missing-indices

Read the linked documentation.

Read the linked documentation.

I ran sudo -u www0data php /path/to/nextcloud/occ db:add-missing-indices. Most of the Security & setup warnings were resolved except for this one:

There are some errors regarding your setup.

Some files have not passed the integrity check. [List of invalid files…] [Rescan…] For more details see the [documentation :arrow_upper_right:].

The List of invalid files is drawio and other problems associated with it. I have an elaborate drawio document I do not want to lose or corrupt. In addition, version 28.0.4 will be available Mar-28-2024 maybe it will address a fix.

However, what can be done to solve the problem with drawio?
Technical information

The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results

  • core
    • INVALID_HASH
      • core/js/mimetypelist.js
    • EXTRA_FILE
      • core/img/filetypes/drawio.svg
      • core/img/filetypes/dwb.svg

Raw output

Array
(
[core] => Array
(
[INVALID_HASH] => Array
(
[core/js/mimetypelist.js] => Array
(
[expected] => 550ab566d30693bfa24ec4b15d9df87731ae8a3be8f79dabf94757e5b8b20eec6e4b678f17af1718297f2872f6b04519eeb024d1dff11947f29da431c7f11201
[current] => 301654cbbe168b8723530db88fd2e40ad688f4e6b0bdaeade5b4fe34bd94d9d3cfe760821e97dc792e585d4b6ccff838597bfd46466bb07d30ff84df4cb79518
)

            )

        [EXTRA_FILE] => Array
            (
                [core/img/filetypes/drawio.svg] => Array
                    (
                        [expected] => 
                        [current] => 92e0974cf869bf8ab969c3442dc2b80d55fde36441d22924db74916a06b407520aa2a9dc39336f9157195ebede697ffac0e639360879255ab91932d406e1897d
                    )

                [core/img/filetypes/dwb.svg] => Array
                    (
                        [expected] => 
                        [current] => 43731dd5f17a048112ea5109b40b02ec019b3ee2324385a0f448e3bd2264cb13dc160ab018d893f92f8e2f168fd09009b51578c8c6b97a02a1617c67ac087701
                    )

            )

    )

)

Thanks!

Delete or move the files

Are these the files to delete or move?

  1. core/js/mimetypelist.js

  2. core/img/filetypes/drawio.svg

  3. core/img/filetypes/dwb.svg

Thanks!

I moved the files:

  1. core/img/filetypes/drawio.svg
  2. core/img/filetypes/dwb.svg

Now, as shown below core/js/mimetypelist.js is INVALID HASH. Is there a replacement hash?

Thanks!

Technical information

The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results

  • core
    • INVALID_HASH
      • core/js/mimetypelist.js

Raw output

Array
(
[core] => Array
(
[INVALID_HASH] => Array
(
[core/js/mimetypelist.js] => Array
(
[expected] => 550ab566d30693bfa24ec4b15d9df87731ae8a3be8f79dabf94757e5b8b20eec6e4b678f17af1718297f2872f6b04519eeb024d1dff11947f29da431c7f11201
[current] => 301654cbbe168b8723530db88fd2e40ad688f4e6b0bdaeade5b4fe34bd94d9d3cfe760821e97dc792e585d4b6ccff838597bfd46466bb07d30ff84df4cb79518
)

            )

    )

)