We completed development on our dev environment and I copied the files over from the dev server to the production server through FTP.

Then through back up and migrade module, I made a back up of the SQL database. I created a new database through Plesk with the same name, username and password. I then imported the SQL database into the new server through phpmyadmin. I go to the URL and get the Site Maintenance message (which is correct, I placed the site in maintenance mode before copying the files over) but cannot navigate to any sub pages. Generally I can add /user or /admin to the end of the url and get the login screen. However all I get are 404 errors.

  • 1
    Can you try example.com?q=user. If this work then it is definitely .htaccess OR URL rewrite issues. Was the site configured in sub directory on dev server? Is your dev server on Linux? Commented Jun 30, 2011 at 1:07

3 Answers 3


It sounds like your .htaccess file is missing, or AllowOverride is disabled. Clean URLs not working? Check your .htaccess file!

  • +1 Try browsing directly to update.php. If that page loads, then the culprit is one of the above.
    – mpdonadio
    Commented Jun 30, 2011 at 1:30
  • This sounds the most likely culprit. Some FTP clients can miss .htaccess so it wont be uploaded. So check that its there (it's in the document root of the drupal install). If it is, as Dylan says, check AllowOveride in your apache record
    – cconolly
    Commented Jul 12, 2012 at 8:27

There could be an abundance of reasons as to why this is happening. The first thing that strikes me is that a backup created by the backup and migrate module is not compatible with phpmyadmin. Those files can only be restored through the backup module itself. My suggestion is to install Drupal as usual, then enable the Backup and migrate module, then restore through the Drupal UI using your backup and migrate dump.

  • Thanks. I realize I am new to this process, but how would I then bring over the css and other files (images, etc) straight through ftp? I have only built 3 drupal sites and have yet to encounter this issue (a friend of mine usually does the process through terminal, however he is unavailable). Also, I have added other modules and configurations with those modules - how would I port those over to the new server with minimal re-do or work to bring the settings back
    – Remy
    Commented Jun 29, 2011 at 21:07
  • You can move the entire file structure over that is on your dev. Then just go through the Drupal install process as normal. When you restore your site using backup and migrate, all of your enabled modules, theme settings and configs will return.
    – user842
    Commented Jun 29, 2011 at 21:33
  • I am not sure if I have never seen a borked database in Drupal give a true 404 and not a PHP error message or a generic WSOD.
    – mpdonadio
    Commented Jun 30, 2011 at 1:43
  • I am not saying that it is a "borked" db. I am suggesting that the entire Db wasn't migrated, resulting in 404s.
    – user842
    Commented Jun 30, 2011 at 3:45

You need to look at the server log to see what is happening. error_log should give a clue.

Personally, I think @Dylan Tack's answer is spot on, but another possibility is that when you transferred the site to the production server, the file permissions got whacked.

The easiest way to do fix is via a shell

cd /the/drupal/install
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

You may also need to tweak your sites/default/files for how your Apache is running. Something like

cd /the/drupal/install/sites/default
chown -R apache.apache files/

Plain FTP is an all-around bad idea. Better ways are

  • Use SFTP (eg, WinSCP under windows)
  • Use rsync
  • Use Subversion
  • Use a VPS account so you can have a virtual hosts on the same server for development, staging, and live
  • Thanks. I ended up figuring it out two days ago. I essentially deleted everything I had done, and did the migrate with rsync and a sql dump, which I then brought over with shell. Then there was a problem with .htaccess in that it was sending it to the former sites URL, which after sometime looking I was able to discover and resolve.
    – Remy
    Commented Jul 1, 2011 at 16:36

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.