Unable to migrate server from deb11 server to deb12

My environment on the old server

Operating system: Linux 6.2.9-x86_64-linode160 #1 SMP PREEMPT_DYNAMIC Wed Apr 5 15:30:32 EDT 2023 x86_64
Webserver: Apache/2.4.56 (Debian) (fpm-fcgi)
Database: mysql 10.5.21
PHP version: 8.1.27
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, json, Reflection, SPL, session, standard, sodium, cgi-fcgi, mysqlnd, PDO, xml, apcu, bcmath, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, imagick, intl, exif, mysqli, pdo_mysql, Phar, posix, readline, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, Zend OPcache
Nextcloud version: 28.0.1 - 28.0.1.1

New Server

**Webserver ** Apache/2.4.57 (Debian)
System Linux deb12.wealthychef.net 6.1.0-15-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.66-1 (2023-12-09) x86_64
PHP Version 8.2.7
Loaded Modules core mod_so mod_watchdog http_core mod_log_config mod_logio mod_version mod_unixd mod_access_compat mod_alias mod_auth_basic mod_authn_core mod_authn_file mod_authz_core mod_authz_host mod_authz_user mod_autoindex mod_deflate mod_dir mod_env mod_filter mod_headers mod_mime prefork mod_negotiation mod_php mod_reqtimeout mod_rewrite mod_setenvif mod_socache_shmcb mod_ssl mod_status
Database mysql Ver 15.1 Distrib 10.11.6-MariaDB

My problem

I’m trying to migrate from a debian 11 server to a new debian 12 server.
The process seemed simple and straight from the documentation here: Migrating to a different server — Nextcloud latest Administration Manual latest documentation
After doing all the steps in that document, I’m left with a non-working nextcloud on the new server.
When I connect to the new machine, I get this error:

Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

There are no messages in any log files that I can find. Where can I start to debug this problem and get this working?
Is there an alternative approach to migrating that I’m missing?
I can install a fresh nextcloud on the new server, but how would I then import or otherwise duplicate the old setup?
Thanks for any help!

Please read this installation guide. Do you have installed all needed php packages named in this installation guide? Can you compare the packages on both server e.g. with:

dpkg -l |grep php

Please post more details e.g. logfiles from apache2 and Nextcloud.

1 Like

Hello, thanks for the reply.
installing a new server That how-to you linked to is about installing a brand new nextcloud instance.
I can install a new instance, but I am not sure what to do once I have that. How do I import my old nextcloud information into a new instance of nextcloud?

logs: After I connect and get that error, there are no log messages in /var/log/apache2/* and there are no changes to files written to /var/www/nextcloud/log or /var/www/nextcloud/data/

Here are all the packages on both servers:

old server

libapache2-mod-php5
libapache2-mod-php7.4
php5
php5-cli
php5-common
php5-gd
php5-intl
php5-json
php5-ldap
php5-mcrypt
php5-mysql
php7.0-cli
php7.0-common
php7.0-json
php7.0-opcache
php7.0-readline
php7.1-cli
php7.1-common
php7.1-json
php7.1-opcache
php7.1-readline
php7.2-bcmath
php7.2-cli
php7.2-common
php7.2-json
php7.2-mysql
php7.2-opcache
php7.2-readline
php7.2-sqlite3
php7.3-cli
php7.3-common
php7.3-json
php7.3-opcache
php7.3-readline
php7.4
php7.4-cli
php7.4-common
php7.4-json
php7.4-opcache
php7.4-readline
php7.4-xml
php7.4-zip
php8.0-cli
php8.0-common
php8.0-opcache
php8.0-readline
php8.1-apcu
php8.1-bcmath
php8.1-cli
php8.1-common
php8.1-curl
php8.1-fpm
php8.1-gd
php8.1-gmp
php8.1-gmp-dbgsym
php8.1-imagick
php8.1-intl
php8.1-mbstring
php8.1-mysql
php8.1-opcache
php8.1-readline
php8.1-xml
php8.1-zip
php8.3-apcu
php8.3-cli
php8.3-common
php8.3-opcache
php8.3-phpdbg
php8.3-readline
php-apcu
php-bcmath
php-cli
php-common
php-console-table
php-curl
php-fpm
php-gd
php-imagick
php-intl
php-mbstring
php-mysql
php-pear
php-xml
php-zip
libapache2-mod-php7.2
php5.6-common
php5.6-imagick
php5-curl
php7.0-imagick
php7.0-phpdbg
php7.1-imagick
php7.1-phpdbg
php7.2-curl
php7.2-gd
php7.2-imagick
php7.2-phpdbg
php7.3-imagick
php7.3-phpdbg
php7.4-curl
php7.4-gd
php7.4-imagick
php7.4-mbstring
php7.4-mysql
php8.0-imagick
php8.0-phpdbg
php8.1-gmagick

New server

php
php8.2
php8.2-apcu
php8.2-bcmath
php8.2-cli
php8.2-common
php8.2-curl
php8.2-fpm
php8.2-gd
php8.2-gmp
php8.2-imagick
php8.2-intl
php8.2-mbstring
php8.2-mysql
php8.2-opcache
php8.2-readline
php8.2-soap
php8.2-xml
php8.2-xmlrpc
php8.2-zip
php-apcu
php-bcmath
php-common
php-curl
php-fpm
php-gd
php-gmp
php-imagick
php-intl
php-json
php-mbstring
php-mysql
php-pear
php-readline
php-soap
php-tokenizer
php-xml
php-xmlrpc
php-zip

I was able to install a new nextcloud instance and import the old database.
I got an error when I tried copying the data folder from the old install to the new, but was able to just copy the data/username folder instead and that seemed to work.
I’m going to call this good.
Thanks for the pointer to the install.
The migration doc seems completely wrong. Following the steps they lay out there does not work at all. Anyhow, thanks!

Here is what ended up working

  • Put the old server in maintenance mode.
  • Export the database using
root@linode (nextcloud ): mysqldump --routines -u root -p nextcloud > ../nextcloud-dbdump.sql
  • set up A record on DNS
  • add a virtual domain for the nextcloud in /etc/apache2/sites-available and then use a2ensite to install it
  • slurp in the mysql dump to the new server:
root@deb12 (www ): mysql -u root -p nextcloud < nextcloud-dbdump.sql
  • spin up a new nextcloud on the new server
  • You have to fiddle with the mysql database to ensure the user in nextcloud/config/config.php is an actual user in the tables.
  • Now copy the user data:
root@deb12 (nextcloud ): rm -rf data/rcook; cp -r data-linode/rcook data/
root@deb12 (nextcloud ): ls -l data
total 728
drwxr-sr-x 8 www-data www-data   4096 Mar 13 08:45 appdata_ock6sagp6p93/
-rw-r--r-- 1 www-data www-data      0 Mar 13 08:45 audit.log
drwxr-sr-x 3 www-data www-data   4096 Mar 13 08:45 files_encryption/
drwxr-sr-x 2 www-data www-data   4096 Mar 13 08:45 files_external/
-rw-r--r-- 1 www-data www-data      0 Mar 13 08:45 index.html
-rw-r----- 1 www-data www-data 720128 Mar 13 08:52 nextcloud.log
drwxr-xr-x 8 root     root       4096 Mar 13 08:52 rcook/
drwxr-sr-x 5 www-data www-data   4096 Mar 13 08:45 rcook1/
root@deb12 (nextcloud ): chown -R www-data:www-data data; 
find data -type d -exec chmod 755 {} \;
find data -type d -exec  chmod g+s {} \;
find data -type f -exec chmod 644 {} \;
  • At this point, the nextcloud server is working well enough to shut down the old one.
1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.