I accidentally deleted the Drupal 8 files, but the database is not damaged. Is there anyway I can bring my site back to live?

I have an old backup of only files. I restored the file of that backup in the root folder, and replaced the database credentials in the settings.php file. It didn't work.

Is there any other way to bring back the site to live from the database?

Note: this is shared hosting.

  • did you run composer install to get your latest dependencies?
    – DiDebru
    Feb 15, 2018 at 14:17
  • @Insasse this is shared hosting. Feb 15, 2018 at 18:33

1 Answer 1


Replace the settings.php with the default.settings.php and re-run the installer.

Use the same database credentials and it should detect that there is an existing installation and say the installer cannot continue. However, you should be able to view the site normally once the installer cannot continue.

  • I'm getting this error. The website encountered an unexpected error. Please try again later. RuntimeException: Failed to start the session because headers have already been sent by "/home/sitname/con.sitename.com/sites/default/settings.php" at line 1. in Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (line 140 of vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php). Feb 15, 2018 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.