I moved a drupal installation from one server to another. Steps I followed:

  1. Copied whole directory structure from old server.
  2. Exported database from old server.
  3. added files to newdomain/drupal
  4. Imported database
  5. edited settings.php with new database information.

As of right now the home page is working (Except for some broken non-db images, but I know the reason for that and can fix it) But none of the links to any of the nodes or any of the admin paths I know seem to exist. I get a 404 File Not Found error.

I wonder if it's related to the fact that this installation is in a subdirectory and the other one was not, but is that enough to make every page except the homepage not function?

5 Answers 5


The link to the modules and themes are hard coded in the system table in the database. Reset them by visiting 'admin/modules', clear the cache, make sure clean urls are on, and make sure any op code cache like APC is cleared if you are using that.

  • I can't access admin on the new location, but would it work to do that on the old site and then re-export the database?
    – Damon
    Feb 9, 2012 at 17:25
  • 2
    Have you tried mysite.com/?q=admin/modules or mysite.com/[new directory]/?q=admin/modules
    – acouch
    Feb 9, 2012 at 17:29
  • Ah that second url format allowed me to get to the login page, and then to where I need to go
    – Damon
    Feb 9, 2012 at 18:30
  • I don't see anywhere to clear the cache, though.. I have the devel module installed, but don't see any option there, either.
    – Damon
    Feb 9, 2012 at 18:33
  • 2
    You can clear the cache at 'admin/config/development/performance' but first you will need to turn off clean urls at 'admin/config/search/clean-urls'
    – acouch
    Feb 9, 2012 at 20:32

Yes, that's possible. You can try to adjust the used base URL by setting the $base_url value in your settings.php .


I had the same problem! The cause was a missing .htaccess file...it didn't get copied when I copied all the other site files. Once I copied that file into the test site, I was able to re-enable clean urls.


For windows server users: I had same issue. I added .htaccess file but no success. On windows server you need to

  • open IIS
  • click URL Rewrite
  • Import Rules
  • point to your .htaccess file in Site
  • import -> Remove any error shown
  • Apply Rules.

That should solve this issue.


If you have any languages configured, you might have to go into the database directly and reconfigure the URLs under the table:  languages, then change the settings under domain.

You can also configure these settings in the GUI under: /admin/config/regional/language if you can get to it.

DON'T FORGET to clear your caches afterward.

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.