What is the correct procedure to copy (transfer) a whole Drupal web with database to a web-hosting service? What are the problems that could occur? I'd like to change only the website name from localhost to domainname. It seems that everything else will be the same. I'm using Ubuntu and Drupal 7.0, Apache, Mysql. Should I consider the operating system of web-hosting and their server, database and similar things?


Roughly speaking, the procedure is to

  1. copy all files to your webserver
  2. create a database on the webserver
  3. export the local database
  4. import the db export in the webserver db
  5. edit settings.php and set the new db name, user and pass
  6. enjoy

The recommended webserver specs can be found at http://drupal.org/requirements. Since you have been developing on Linux, Apache and MySQL, use the same on your webserver (unless there is an important reason to change it). Also pay attention to your PHP version. Recent Ubuntu versions come with PHP 5.3, so it's best to use that on your server as well.

To prevent problems while importing your database (especially if you're using a tool like phpMyAdmin), it can help to empty (truncate) all cache_ tables before exporting it.

  • Thank you, could you please elaborate more the points 2-5? Or send me link with information? I havent done this before and dont have experience. The database on the server should have the same name? And the change of domainname is automatic?
    – xralf
    May 11 '11 at 9:31
  • There is a lot of information on the web (google.com/search?q=drupal+localhost+to+live) and on drupal.org (drupal.org/node/46389#comment-87000, drupal.org/node/333675), but to my surprise I could not find a simple explanation of the procedure above. Answering your questions: the database does not need to have the same name, because you can change the name when editing settings.php in step 5. If you didn't hard-code the domainname anywhere, the change should just work. May 11 '11 at 10:41

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.