Internal Server Error after moving Nextcloud

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2): 17.0.5.
Operating system and version (eg, Ubuntu 17.04): Ubuntu 18.04.4 LTS
Apache or nginx version (eg, Apache 2.4.25): 2.4.29
PHP version (eg, 7.1): 7.2.24

The issue you are facing:

I’m hosting Nextcloud on a virtual server. Until yesterday it ran on a Ubuntu 16.04. Server, but for (not further discussed) reasons i had to move my Nextcloud server to the clean and freshly installed Server specified above.

Using the Nextcloud Backup and Restore documentation, i made a backup of my Nextcloud-Folder and Database and moved it to the “new” server.
After installing all the required packages and php-extensions the Nextcloud server displays an internal server error with the following error message:

Thank you very much for your help in advance!

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. ?

The output of your Nextcloud log in Admin > Logging:


The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

$CONFIG = array (
  'instanceid' => 'MYID',
  'passwordsalt' => 'MYPASSWORDSALT',
  'secret' => 'MYSECRET',
  'trusted_domains' =>
  array (
    0 => '',
    1 => '',
  'datadirectory' => '/var/www/MYCLOUD/data',
  'dbtype' => 'mysql',
  'version' => '',
  'dbname' => 'DBNAME',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'DBUSER',
  'dbpassword' => 'DBPASSWORD',
  'logtimezone' => 'UTC',
  'installed' => true,
  'maintenance' => true,
  'theme' => '',
  'logfile' => 'nextcloud.log',
  'loglevel' => 'All',
  'debug' => true,
  'data-fingerprint' => 'DATAFINGERPRINT',
  '' => 'stable',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'mail_from_address' => 'XYZ',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_domain' => '',
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
  'mysql.utf8mb4' => true,
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauth' => 1,
  'mail_smtphost' => '',
  'mail_smtpport' => '465',
  'mail_smtpname' => ' ',
  'mail_smtppassword' => 'MYTOPSECRETPASSWORD',
  'app_install_overwrite' =>
  array (
    0 => 'files_downloadactivity',
    1 => 'admin_notifications',
  'trashbin_retention_obligation' => 14,
  'updater.secret' => 'UPDATERSECRET',

The output of your Apache/nginx/system log in /var/log/____:

(no relevant information displayed :/)

Is it possible to delete everything on the server, except:

apps - if you have special apps.

And untar the zip from

“MySqlExpressionBuilder not found” ???

Look for lib/private/DB/QueryBuilder/ExpressionBuilder/MySqlExpressionBuilder.php

Thank you for your fast answer! I’ll give it a try.
Deleted everything but the apps, config and data folder and the logfile:

And downloaded the nextcloud release (v17.0.5 -> same as my instance) and extracted it to my document root. Edited the file permissions with chown and chmod and restarted apache (service apache2 restart) just to be safe.

And finally i can log in to my nextcloud instance and the issue seems to be resolved.
Even though i don’t think this step should be necessary, it solved my problem.
Thank you all very much!