Koozali.org: home of the SME Server

Nextcloud updates - NC24 and mariadb migration for existing installs

Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Nextcloud, do you use it ?

If not, please give it a try.

We have been improving your experience of it with SME. It allow you to work simultanously on one ibay from samba and from Nextcloud.

Your groups and users are synced using the SME integrated LDAP directory.

Last updates :
- migrate NC 24.0.2 for initial install
- fix gencache again [SME: 12096]
- fix ldap users/groups not availables on first run [SME: 12095]
- migrate property CloudDomain to VirtualHost [SME: 11918]
- use mariadb105 on new installs [SME: 11343]
- update rewriterules [SME: 11972]
- update to NC24 [SME: 12094]
  use a nextcloud-src rpm and avoid conflicts between web and rpm updates
- add to backup [SME: 12016]


If you use already nextcloud on SME 10, you might have found yourself stuck on NC20 because of the database, this has been solved, update to last smeserver-nextcloud version in smecontribs and then follow this procedure to migrate your db to mariadb 10.5 :  https://wiki.koozali.org/Nextcloud#Change_Database

We suggest you to update then up to NC 23, which will be supported until late 2022. Wait a little to upgrade to NC 24 as few extensions are still not ready.

Offline bclayton

  • *
  • 137
  • +0/-0
Re: Nextcloud updates - NC24 and mariadb migration for existing installs
« Reply #1 on: July 11, 2022, 01:25:20 AM »
Thanks for this procedure!  I use Nextcloud and followed your instructions and everything worked well.

The only issue that my Nextcloud installation shows is this: SQLite is currently being used as the backend database. For larger installations we recommend that you switch to a different database backend. This is particularly recommended when using the desktop client for file synchronisation.

Can you tell me the best way to do that?

Thank you!

Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Nextcloud updates - NC24 and mariadb migration for existing installs
« Reply #2 on: July 11, 2022, 08:15:33 AM »
sqlite is neither the default we use in the contribs, neither a procedure we propsoed on the wiki,
if you really add a sqlite contrib at a time for your NC, then you will have to dive into NC forum to see how to migrate. This should be pretty similar to what is migrating from maria55 to maria105

what gives
Code: [Select]
occ config:system:get dbtype

Offline bclayton

  • *
  • 137
  • +0/-0
Re: Nextcloud updates - NC24 and mariadb migration for existing installs
« Reply #3 on: July 11, 2022, 02:37:17 PM »
Thanks.

[root@provue-server ~]# occ config:system:get dbtype
sqlite3
[root@provue-server ~]#

Not sure this matters, but this server did have Owncloud installed before I upgraded to V10.

Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Nextcloud updates - NC24 and mariadb migration for existing installs
« Reply #4 on: July 11, 2022, 11:17:07 PM »
you need to migrate from sqlite to mariadb

https://docs.nextcloud.com/server/18/admin_manual/configuration_database/db_conversion.html


just not sure need before to create db and user with access

php occ db:convert-type --all-apps mysql nextcloud 127.0.0.1:/var/lib/mysql/mariadb105.sock nextcloud

Offline bclayton

  • *
  • 137
  • +0/-0
Re: Nextcloud updates - NC24 and mariadb migration for existing installs
« Reply #5 on: July 12, 2022, 03:04:08 AM »
In looking at the Nextcloud documentation, it looks like a new db is needed:

"Run the conversion

First set up the new database, here called “new_db_name”. In Nextcloud root folder call

php occ db:convert-type [options] type username hostname database"

I don't want to bomb my system, so would that be the safe bet?  I do have reliable backups, just in case.

Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Nextcloud updates - NC24 and mariadb migration for existing installs
« Reply #6 on: July 12, 2022, 02:27:05 PM »
the command i post it in last message.

you have confirmation that you need to create the db. you can use the part of the migration to mariadb105 in the wiki page to create user and db. 

you need the option all app.

make a backup of your sql db and your config.php before proceeding.   

this is indeed always a risk that something get wrong

if you do not inow where is your sql db they search for the occ command to get the db path. 

Offline bclayton

  • *
  • 137
  • +0/-0
Re: Nextcloud updates - NC24 and mariadb migration for existing installs
« Reply #7 on: July 12, 2022, 07:10:01 PM »
Thanks, JP.

I'll give this a shot.

Offline monoman

  • **
  • 45
  • +0/-0
Re: Nextcloud updates - NC24 and mariadb migration for existing installs
« Reply #8 on: August 15, 2022, 12:36:13 AM »
Are there any gotchas I need to look our for upgrading a largish Nextcloud install of 300Gb of data in hundreds of shared customer folders?  I am somewhat concerned I may stuff this up.

Just to be clear I am going about this the right way, these are the steps as I understand them.

1. Backup SME server
2. Upgrade to smeserver-nextcloud.noarch  1.2.0-17.el7.sme  via yum
3. Follow the CHANGE DATABASE steps in https://wiki.koozali.org/Nextcloud#Change_Database
4. Incrementally upgrade NC from 20.0.14 to 21.0.9 to 22.2.10 to 23.0.8
5. Test and be happy

Thanks

One last thing.  Why is this called NC24 when we are only updating to 23?


Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Nextcloud updates - NC24 and mariadb migration for existing installs
« Reply #9 on: August 15, 2022, 01:43:19 AM »
correct for the steps

the most important thing is to backup your db and your /usr/share/nextcloud

user data is in /home/e-smith/files/nextcloud and is safe from the changes.

the two things you could mess up are really db and software dir.
use a
cp -a /usr/share/nextcloud
or a
tar -czf nextcloud.tgz /usr/share/nextcloud


for nc24, the new rpm nextcloud-src has been built against nc24 sources before i saw that a lot of modules were not yet available. too much work to undo, while people with nc already installed will have to manually update and could stop before (at nc23). the new rpm will install nc24 only on new installs. and even if you are doing a new install you could still manually put a tgz of nc23 in nextcloud-src folder

the new rpm will also prevent conflict with rpm overwriting the software folder on update. i had to conflict with error in pre scriptlet to avoid this before.
here the nextcloud-src will only rewrite the app folder if it is empty. so on migration one must took care to backup its config file out and only import it after nextcloud is running. at least for the moment.
« Last Edit: August 15, 2022, 01:56:10 AM by Jean-Philippe Pialasse »

Offline monoman

  • **
  • 45
  • +0/-0
Re: Nextcloud updates - NC24 and mariadb migration for existing installs
« Reply #10 on: August 15, 2022, 04:11:20 AM »
It took around an hour to run.  The entire upgrade process ran without issue.

Thank you JP for helping clarify this for me.

Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Nextcloud updates - NC24 and mariadb migration for existing installs
« Reply #11 on: August 15, 2022, 06:06:37 PM »
Great news to read !

all the best to you !

Offline pat

  • *
  • 22
  • +0/-0
Re: Nextcloud updates - NC24 and mariadb migration for existing installs
« Reply #12 on: September 01, 2022, 05:53:16 PM »
And for me it's the same !
All work fine and collabora is Ok
Thank you JP for this great job !

Offline monoman

  • **
  • 45
  • +0/-0
Re: Nextcloud updates - NC24 and mariadb migration for existing installs
« Reply #13 on: September 12, 2022, 12:44:02 AM »

We suggest you to update then up to NC 23, which will be supported until late 2022. Wait a little to upgrade to NC 24 as few extensions are still not ready.


Is it safe to upgrade to 24.0.5 if nextcloud Security & setup warnings report All checks passed?

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Nextcloud updates - NC24 and mariadb migration for existing installs
« Reply #14 on: September 12, 2022, 01:00:44 AM »
Can only report my experinces, two prod systems now updated without issue, both operating with 24.0.5
--
qui scribit bis legit