Site moved to new location, NextCloud does not work

Due to issues with hosting provider, had to copy site to new location. Now I cannot run NextCloud on new server. The error I receive is: 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.

Any suggestions?

I’m wondering if I should simply rename my old folder (for NC), perform a fresh install and new database, then copy over old data files. Anyone think that might help?

We need to see logs chap. A 500 (internal server error) can be any number of things, some being very easy to fix.

So it took me all day, but I had to go the manual install route. Snap failed miserably, and so did web install. I ended up getting this working just a few moments ago with a fresh install and manual database and db user creation. Now I just have to copy over the previous data files to new location. Once I do that, will all the users revert back over, or are they hidden in a database somewhere?

Users, shares, calendars and other app data is all in a DB. If you can, take a DB backup along with the config.php file and push them to the new environment (DB import to another new DB, file copy to /config/config.php after taking a backup of the current install config.

Then you can see if you can get the environment back up in the “old” state and if it fails, revert to the clean install and DB

Thanks for steering me the right direction. You answered my next questions. However I am no longer on a “shared hosting” environment, but on a private server I built at my office. I installed this new copy of NextCloud 12 on this server, and it is working right now “bare bones” fresh install. Would it make more sense for me to just IMPORT the old database into the newly created database? The old db version was mysql and the new one is at version of mysql. I also do not have the same data structure as the shared hosting environment. So before I get started, would the following steps work?

  • IMPORT old db into new db
  • Copy old data into newly created DATA location?


Don’t overwrite your new DB. You can use that as a fallback if the imported DB and config doesn’t funtion correctly rather than having to setup new all over again.

Best would to create a 2nd DB on your new system as I said, and import the old one there, along with the config.php file which will need minor edits to reflect the new setup.

Import the data from the old data directory to the new before switching out the config files. No further work needed, if you decide to go with the new install instead you can run an occ scan on the imported data.

If you’re not concerned about users, shares and other meta then stick to the new install. If you’re potentially losing a lot of time re-setting it up, do the migrate instead.

I am absolutely concerned about users, shares, and meta data. I want the site to come up exactly as the old site did. I am confused on the config.php edits though. The old old used a mysql 9. database whereas the new system uses a mysql 12. database. Why not just edit the existing?

So my question now begs, which config do I use? I have currently installed on my machine the NextCloud v12 whereas the OLD system was at v9.0.5 My OLD config.php looked like this:
‘dbtype’ => ‘mysql’,
‘version’ => ‘’,
‘dbname’ => ‘hopehea3_cloud’, (name of OLD database on shared hosting provider)
‘dbhost’ => ‘localhost’,
‘dbtableprefix’ => ‘oc_’,
‘dbuser’ => ‘dbuser’, (not actual of course)
‘dbpassword’ => ‘dbpassword’, (not actual of course)
‘logtimezone’ => ‘UTC’,
‘updater.server.url’ => ‘’,
‘installed’ => true,
‘maintenance’ => true,

So what “edits” might you suggest here?

-Jim H.

Oh blimey you’re talking about nextcloud version rather than mysql. I didn’t even consider the version numbers.

That does make this more difficult. I’d be inclined to setup a v9 NC server new, migrate then update to 12.

@tflidd concur?

@JasonBayton you are absolutely right. You can migrate to a newer apache or mysql version, there should be no problem with that. But you must keep the same Nextcloud version. Between Nextcloud versions, there can be changes in the database structure (even if there is nothing in the core, it could still be valid for apps). Therefore, you can’t just reuse a database from Nextcloud 9 in Nextcloud 12. The correct steps would be to migrate to NC 9, then upgrade to NC 10, then to NC 11, then to NC 12. In between, don’t forget to enable all your apps, login to make sure everything was converted.

So the plan of attack:

  • Obliterate the 12 install
  • Install 9.x (matching the version you have), but stop at the point of getting to the welcome/install page (where db details are input)
  • Stop apache, copy your config file across to the /nextcloudinstall/config/ directory
  • Import your database as a new DB into your new system, ensure the DB users are the same also else you’ll need to change the config file
  • Make sure the URL, override server address, etc are correct in the conf file
  • Import your data to the data directory
  • Start apache

It should then come up as it was, but on the new server.

1 Like

Hello Jason.

So I literally spent all weekend working on this dawg-gone thing. I simply cannot install NextCloud 9! There is no command-line installer, there is no web installer (setup-nextcloud.php is missing). The occ installer fails with ‘’dbhost’’ error. I’m at my wits end here, and certainly not looking very good with my company right now.

Don’t suppose you have any other suggestions to get NC 9 installed?

You do it the old-school way :slight_smile: unzip to a directory in your webserver, setup your vhost and then visit the URL to confirm it works. There’s no occ commands to run.

I could offer to do it for you, but I’m not sure granting access to a 3rd party will make you look too good either.

Jason, I did it the old-school way. When I go to - - - nothing happens.

At this point in time, I am more than happy to grant you access. To me, the ends justify the means.

What access who you need?

Shell access to your server. I’ll PM you.