I have a database backup from a hacked drupal site. The source code of the hacked website has been lost. When I try to make another installation of the site working using the old database, I have the following error:

Fatal error: require_once(): Failed opening required 'C:\ampps\www\drupal.fox\drupal/sites/all/modules/date/date_api/date_api.module' (include_path='.;C:\php\pear') in C:\ampps\www\drupal.fox\drupal\includes\bootstrap.inc on line 3168

How could I avoid such errors? is there any way to make drupal runs temporarly without missing modules or even is there a tool that able to download and install missing modules?


Not sure about a tool to download all the modules, but you can do this pretty easily by checking the system table.

Run this:

SELECT *  FROM 'system' WHERE 'filename' LIKE '%module' AND 'status' = 1

You will get a list of module names, and the filename shows where the file was stored. Now, you can download the modules from drupal.org (check the schema version if you have doubts about 1.x, 2.x, etc minor version).

If the status of the module is shown as 1, that means the module is enabled, and there can be tables or any other database changes done by this module. You should not uninstall those modules, because you are going to lose all that data when you uninstall it (!= disabling a module).

Also, use registry rebuild module, which adds a handy drush rr to rebuild the registry. You will also need to clear caches a lot (drush cc all) to fix any theme registry mismatches. If you have a custom theme and/or have custom tpl.php files custom modules or custom themes, you will not be able to restore the 100% functionality unless you have those files.


You can set status to '0' in table 'system' for missing modules P. S. 'drush cc all' is a must-run command after the manipulation like this or manually empty cache tables

  • Good, I tried this but I still got the error. Is there any way to clear cache from the database?
    – SaidbakR
    Feb 22 '15 at 0:03
  • There is another mention about enabled modules, in 'cache_bootstrap'. Just truncate all cache tables for being sure or use 'drush cc all'
    – Paul Nike
    Feb 22 '15 at 2:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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