Nextcloud Migration between Ubuntu to Almalinux With NFS Mount

Hello this is my first time posting a support topic in here so apologize if there is any mistake

Long time ago I set-up nextcloud server on Ubuntu 16.04 LTS,
My setup was Using Server for the nextcloud installation and using QNAP with NFS mount as a data folder on nextcloud

this is the setup for /etc/exports from NAS


and in my old ubuntu server, this is the setup for fstab:   /var/www/html/nextcloud/data  nfs defaults     0       0

and everything went well with my old ubuntu server,

now the problem, because Ubuntu 16.04 is EOL and i need to consolidate all my apps to one server I need to migrate my nextcloud installation to another server which is using Almalinux 8 and also to update my nextcloud version to the recent (after I successfully migrate it of course)

Already read all the documentation related to migration, and basically everything from sync all the necessary files from old server to the new server and upload the database is success,

Nextcloud version (eg, 20.0.5): 15.0.X
Operating system and version (eg, Ubuntu 20.04): Almalinux 8
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.x Latest
PHP version (eg, 7.4): 7.2.X Latest

The issue you are facing:

after following the step by step migration when I run the nextcloud, return in internal error and on the nextcloud.log there is no log created, so my guest would be permission, and suddenly I notice that after I mount nfs4 of my qnap into my almalinux server all the file and folder inside data folder using old uid and gid from ubuntu uid=33 (www-data) and gid=33 (www-data), and centos based doesnt have user id 33 and gid 33 translate to group ‘tape’

When i unmount the NFS, nextcloud template load and data folder error occurred which is already predicted, and when try to re-mount again, the internal server error appeared again.

So my question:

my initial thought would be user and group that mismatch from my old server to my new server, if let say I just replace all the user and group from let say to uid=1000 and gid=48 in my QNAP NAS to match for my new centos based server, is it possible? and would this process will damage my nextcloud accessibility to the data?

or there is another simple method to make NFS data accessible with the new server?


I try to change manually update my appdata folder consist of themes and .ocdata to 1000:48 and nextcloud load successfully to maintenance mode, but Im still afraid to disable maintenance mode, since the rest of the file still in user;group=33:33

any hints will be appreciated, thank you

here is the log from my nextcloud.log (after I manually chown to 1000:48):

{"reqId":"ZNSCVezcoDVORQyUgXrbjAAAANI","level":3,"time":"10 August, 2023 06:23:18","remoteAddr":"","user":"--","app":"core","method":"GET","url":"\/cloud\/","message":{"Exception":"RuntimeException","Message":"Could not get appdata folder","Code":0,"Trace":[{"file":"\/var\/www\/html\/cloud\/lib\/private\/Files\/AppData\/AppData.php","line":107,"function":"getAppDataFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":[]},{"file":"\/var\/www\/html\/cloud\/lib\/private\/Template\/JSCombiner.php","line":94,"function":"getFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":["core"]},{"file":"\/var\/www\/html\/cloud\/lib\/private\/Template\/JSResourceLocator.php","line":114,"function":"process","class":"OC\\Template\\JSCombiner","type":"->","args":["\/var\/www\/html\/cloud","core\/js\/merged-template-prepend.json","core"]},{"file":"\/var\/www\/html\/cloud\/lib\/private\/Template\/JSResourceLocator.php","line":70,"function":"cacheAndAppendCombineJsonIfExist","class":"OC\\Template\\JSResourceLocator","type":"->","args":["\/var\/www\/html\/cloud","core\/js\/merged-template-prepend.json"]},{"file":"\/var\/www\/html\/cloud\/lib\/private\/Template\/ResourceLocator.php","line":78,"function":"doFind","class":"OC\\Template\\JSResourceLocator","type":"->","args":["js\/merged-template-prepend"]},{"file":"\/var\/www\/html\/cloud\/lib\/private\/TemplateLayout.php","line":328,"function":"find","class":"OC\\Template\\ResourceLocator","type":"->","args":[["vendor\/core","js\/merged-template-prepend","search\/js\/search","core\/l10n\/en","js\/backgroundjobs","search\/l10n\/en","search\/js\/searchprovider","js\/jquery-ui-fixes","js\/files\/fileinfo","js\/files\/client","js\/contactsmenu","js\/contactsmenu_templates","js\/maintenance-check"]]},{"file":"\/var\/www\/html\/cloud\/lib\/private\/TemplateLayout.php","line":160,"function":"findJavascriptFiles","class":"OC\\TemplateLayout","type":"::","args":[["vendor\/core","js\/merged-template-prepend","search\/js\/search","core\/l10n\/en","js\/backgroundjobs","search\/l10n\/en","search\/js\/searchprovider","js\/jquery-ui-fixes","js\/files\/fileinfo","js\/files\/client","js\/contactsmenu","js\/contactsmenu_templates","js\/maintenance-check"]]},{"file":"\/var\/www\/html\/cloud\/lib\/private\/legacy\/template.php","line":211,"function":"__construct","class":"OC\\TemplateLayout","type":"->","args":["error",""]},{"file":"\/var\/www\/html\/cloud\/lib\/private\/Template\/Base.php","line":132,"function":"fetchPage","class":"OC_Template","type":"->","args":[]},{"file":"\/var\/www\/html\/cloud\/lib\/private\/legacy\/template.php","line":360,"function":"printPage","class":"OC\\Template\\Base","type":"->","args":[]},{"file":"\/var\/www\/html\/cloud\/index.php","line":69,"function":"printExceptionErrorPage","class":"OC_Template","type":"::","args":[{"__class__":"RuntimeException"},500]}],"File":"\/var\/www\/html\/cloud\/lib\/private\/Files\/AppData\/AppData.php","Line":86,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/ Safari\/537.36 Edg\/115.0.1901.200","version":""}

I don’t know if it’s a good idea to continue using Nextcloud 15. Nextcloud 15 is 6 years old and you would have to update the system 12 times in total. It’s very likely that this won’t work. Nextcloud <= 24 is End of Life.

I would create a new Nextcloud 27 on a new system, create the users and import the files into the new system. You can also migrate contacts and calendars with a little effort per user. But the shares are lost.

If you want that, feel free to ask how to do it.

Maintenance and Release Schedule · nextcloud/server Wiki · GitHub

In the future you should upgrade to a new release twice a year.

1 Like

so is it possible with the newest installation of nextcloud and migrate all the old files and users detail from old version to new version? how to do that?

My concern only the files and account, and the existing NFS, I dont want to reupload everything from the start.
I have almost 5 TB of files in NFS, I dont mind if the share lost, the domain/ip address are change anyway.

and what about the user:group in NFS that came from the old server (ubuntu), can i Just change it to the new one(almalinux)? because i use SQUASH_NO_USERS in the nfs setting,
what is the best setting for NFS export files?

You can copy it in the Nextcloud-linux-filesystem-dirs and use
occ files-can --all

First you need thebinstallation, users and then the dirs exists.

thank you for the reply,

how to import users from old installation to new installation?
and is it possible to use existing NFS folder structure without relocate it as a data folder? (without copy to another place/folder?