I want to move my drupal site to a new server.
is this doable?

is it just a matter of dumping mysql dbs, and moving the drupal home to the new server?
any caveats in this process?



gnat’s picture

mysql dump, and moving the files.

the one thing to add is that you set apache on the new server so that it is set up to accept requests to your domain, and that your domain is repointed to the new server.

sjames’s picture


adavidow’s picture

Yesterday I migrated the MySQL dump, plus all files, from my localhost to a development server and seem to have accumulated some permissions problems (users not able to see pages that they should). I checked the .htaccess and config.php files, and they seem to be proper for the new location, and both MySQL instances should be the same (but, now that I think of it, may be slightly different versions).

Given that content and most functionality seem to be fine, are there any obvious gotchas that I should be looking at first?

sjames’s picture

I didn't have any problem with migrating drupal to a new server.
mysqldump didn't work, so I had to do a manul dump after turning off the dbs.
all went well for me.

the full octave’s picture

hi adavidow,

I have had similar problems with permissions when downloading the Drupal files and folders. I think it's a problem with (chmod) permissions. I'm still trying to work out what it is.

Did you find out what was causing the problems you were having?


--------------------------- --------------------
Graphic Designer.
New to Drupal and loving it large.

adavidow’s picture

We tried again, paying attention to the settings.php file, and all seemed well:

MySQL dump + all associated files (modified themes, etc.) + settings.php

echidna’s picture

The drupal installation in the new host is to have a new URL i.e. the original drupal installation is www.mydomain.org; the new URL is test.internal.mydomain.org.

I've done the mysqldump and recreated the db on the new host and set up the correct permissions. I copied the entire drupal folder to the new host.

I've updated the settings.php accordingly

The home page displays without theming, and every internal link on the page does not work.

What could I have missed or done wrongly?

Any advice is deeply appreciated.

sjames’s picture

..did you keep the same drupal release for the migration, or did you upgrade to a new release?

sounds like the mysql dbs is corrupt or something went wrong with the mysql dbs creation.
did you get any errors when you created the dbs before importing it?

you could do a manual backup of the mysql dbs and use that instead of the mysql dump.
I haven't had good luck with mysqldumps.
if you do the manual dump, turn of the database before the backup.
on the new server, turn off mysql and transfer the database backup.
this procedure worked for me.

echidna’s picture

Thank you sjames for replying so quickly to my cry for help.

I've used the same release and same OS version on the new server - Fedora Core 2 with the same version of Apache and kernel and MySQL.

There were no errors on creating the db or mysql dump. I tried mysqldump several times and tried manual backup several times using the method you suggested.

I even upgraded Drupal to 4.6.6.

I still have the exact same problem. I can see the home page with no theming, and every internal link does not work. The error message is "The requested URL /node/ was not found on this server."

I am clueless at the moment.

Any advise is appreciated.

DElyMyth@www.delymyth.net’s picture

The error message is "The requested URL /node/ was not found on this server."

Just guessing, but are you sure you copied all the rewrite rules needed by Drupal to the new server?
It seems it doesn't see the clean URLs...

echidna’s picture

Thank you, DEIMyth, for your suggestion.

I'll compare the .htaccess files on both servers.

Are the clean URLs implemented by rewrite rules in .htaccess or httpd.conf?

I ask because I don't recall setting up rewrite rules for clean URLs. I vaguely remember configuring clean URLs from the admininster->settings page within Drupal. The only rewrite rule I have in httpd.conf is to map mydomain.com to www.mydomain.com.

I apologize for my ignorance. So far, I've been using downloadable modules, and doing configuration via checkboxes and radio buttons within Drupal.

I'm am trying to learn module writing and theming over the next quarter.

Thanks all for your collective patience.

DElyMyth@www.delymyth.net’s picture

Are the clean URLs implemented by rewrite rules in .htaccess or httpd.conf?

Clean URLs are set up in the configuration section of your drupal installation, but for have them working you need to set up the corresponding rewrite rules in your .htaccess file.
You can find them in the drupal .tar.gz, in the htaccess file that ships with drupal.

Hope this helps.

valerama’s picture

Solved it for me. My standard copy of the files excluded the invisible files, so the htaccess file didn't go along for the ride. All I had to do was create it and paste the appropriate code.

Thank You!

sjames’s picture

your database has references to www.mydomain.org
your new url is test.internal.mydomain.org
the nodes only know about www.mydomain.org

I think if you do a web redirect from www.mydomain.org to test.internal.mydomain.org that may solve the problem.

the web redirect could be done in an index.html file which sits in the httpdocs parent directory(document root).

echidna’s picture

Thanks all for your advice.

It seems that the rewrite engine in the servers httpd is problematic. I set up a standard html virtual host and tried to do some rewrites forcing test.mydomain.org to www.test.mydomain.org. I got a "redirect limits for this URL exceeded ..." error message.

I'm trying to find out what's causing the rewrite problem.

I'll let you know what I find.

xamox’s picture

The same thing was happening to me where the home page was being displayed but nothing else worked.

I had to make sure that mod_rewrite was enabled on the new server I was migrating too and that mod_rewrite rules are setup in my .htaccess file.


Cruzeta’s picture

I had the same problem with theming.

I my case the problem was the permission in the "sites/default/files" directory.

It was not writable.

prackley’s picture

Have you updated the sites file to reflect the new url?

mjolley@buy-hot.com’s picture

Hi all,

I did the following:

Export the DB with PHPMyAdmin.

Copy all the files to the new install as root with cp -ruv

chown -R and chgrp -R all the files to the correct user

Create a database and a user for the database with Cpanel

Run the SQL from PHPMyAdmin to create the tables

Update sites/default/settings.php with the new domain name and database and user names and password

At this point when looking at the site I'd expect to see the "site under maintenance" screen since this was how the old site was set up. Instead I see "403 Forbidden." I see the same when I look at mysite/user where I'd expect to see the login screen.

I checked .htaccess and it's the same as the old one. I can't think of what I could have missed. Any ideas?

mjolley@buy-hot.com’s picture

Oh, .htaccess wasn't *exactly* the same. Note to self: Always delete that thing before an install.

droopzilla’s picture

i set up a drupal site for a friend/client not expecting him to change servers on me w/out advising me first. now he complains his site is "broken". i wasn't able to run a mysql dump or even manual backup; all i have are the copies i made via ftp before a drupal upgrade before the server switch.

how can i reinstall drupal to be close to its original state? is that even possible w/out using the methods you lay out here, or must i break it to him that he shouldn't have switched w/out letting me know?

is it at all possible to simply install drupal, load the old database content in phpmyadmin and done? or not so easy?
thanks in advance for any assistance you can lend.


mjolley@buy-hot.com’s picture

If you can access phpmyadmin, you can access everything. Right? Oh, you might not have root. I had to do all this stuff manually because my CPanel doesn't have Drupal 7. If you can just install the version of Drupal you want, you're fine. You might have to delete .htaccess from the file manager if Fantastico or whatever gives you a problem.

mjolley@buy-hot.com’s picture

Actually I'm not 100% sure. After the Drupal install you might have to delete and recreate the database by running the SQL from your backup, but you can do this all with the control panel and phpmyadmin.

Oh, also I didn't really need root. I could have done that other stuff with FTP but it would have consumed bandwidth.

mjolley@buy-hot.com’s picture

His hosting provider, if he's any good, should still have a backup and be willing to provide it, BTW.

droopzilla’s picture

his hosting pvovider was no good at all. he's tried to get backups but apparently this place just up and closed.

so i'm going to attempt setting up drupal from scratch on this new host's server. i'm hoping to be able to load the data from the dbs in the ftp backup i have. i have text and html backups of all the pages and content from the backup. i'm just hoping not to have to enter each post and page all over again. that's the main reason i hope this db idea works. i'm still learning mysql and php as i go along, so i'm no pro, barely a novice at troubleshooting,

i'm going to use 4.6.6 because the theme he requested is not ready for 4.7 yet. (connections, phptemplate)

i'm hoping things work out. from the posts above, it seems that this should work.

if you have any comments or tips, please fire away.


droopzilla’s picture

i installed drupal and created the first account. i then went into phpmyadmin and deleted the drupal database, then recreated it but uploaded the mysql backup i had. i tried to login but no go.

gotta get some sleep. i'll check back tomorrow when i try this again.



chris8185’s picture

I would follow everyone's suggestions in this thread. Moving your site to a new server is a pretty simple process once you dump the database off the old server and reload the db onto your new server.
The one thing that I missed in moving all of the files over to the new server was the .htaccess file in the Drupal root. My website would come up when I went to the home directory, but all of my links were failing. I use FileZilla for my FTP client and I found that .htaccess is a hidden file so it didn't get ftp'd to the new server. Make sure that your .htaccess file makes it to the new server so that your links work properly.

Christopher Kwiatkowski
Application Analyst Associate
University of Georgia

alpinejag’s picture

I just recently migrated from a server that I had been running to hosting my site on Site5. I did the typical migrate, dump sql, move all the files over (including .htaccess) and edit settings.php
The site works fine except that I can't login. When I go to the login screen everything looks fine. After I type in my login info and click the button I just go back to the login screen. I've check the user table and all the data is fine. The version on my server works perfectly fine.
Any suggestions would be greatly appreciated.

the site is www.bazards.net

Peter Huerter’s picture

Hi, I am having the same problem as you describe. I am totally stumped. Thanks for any help you are able to provide. Sincerely, Pete.

field4000’s picture

It is a .htaccess issue. Make sure you copy across you .htaccess file.

robtheorg’s picture

One of my friend's has asked me to help him move an old (4.4.x) Drupal installation from a standalone server to a shared server.

I have the MySQL dump - and all of the files out of the Drupal directory.

Going through the SQL dump - it looks like there are a lot of historical info in the tables (like log, cache, audit).

Can I get away w/ leaving some of the historical activity data out of the new database - and if so - which tables do I just need to create, but not move the old data over to?

(I have been running into consistency issues w/ the SQL dump file - and have been trying to cut and paste the data - but the size of some of the records/entries is ridiculous. I am just trying to get the site over to the new server - and once that is done - I will have the luxury of planning out the upgrade to a newer version of Drupal).



marlowx’s picture

i have succesfully installed drupal 4.7 on the new server... and did the initial setup of the database (mysqul) on the new server...

then do i upload the modules and theme from the old server and then don't touch them until database is migrated/imported from old server or do i activate them now?

then, will the new database inherit the old password etc from the old database or will it keep the new log in details that i created when i installed drupal on the new host?

thanks guys!


new server: http://NoteToSelfDontDie.co.uk

old server: http://NoteToSelfDontDie.com

feropluris’s picture

Hi all,

during a migration we observed some issues connected with particular modules like views. Following your ideas and using the dump of the db, there were still errors from php code. Actually it was not php itself. It was necessary to exclude such modules from the list in admin/build/modules, save the configuration, check them again and finally save the configuration.

I hope it can help. Best


olszakmike’s picture

I've migrated a drupal installation that i've setup with XAMPP to a webserver. backed up the db using the backup and migrate module and copied all the drupal files to the webserver with an ftp program.

I've adjusted the db info in settings.php

when i brawse to the website all i see it this (follow the link for a screenshot). it's like the theme is not being displayed or something. not sure what to do here. any suggestions?


olszakmike’s picture

Just to update on the issue i had. I solved it with the help of the thread below.


basically the problem was caused by the garland theme. I had the colors changed on my xampp installation. as most of you probably know a new instance of the theme is created in /sites/default/files/color/garland-a139034a

the css file in there could not be read.

there were lot's of workarounds for this but the one that did it for me was to comment our line 2 and 3 from the .htacess.php in the /sites/default/files folder.

edleob’s picture

Thank you for coming back and updating this with what worked for you. It saved me a lot of frustration.

jroque’s picture

Please help! I move my drupal installation directory to new hosting server, recreated the database and restoring its data from a sql dump and updated my settings.php file to point to the the new MySQL server and I got the following error when going to my website:

// $Id: index.php,v 1.91 2006/12/12 09:32:18 unconed Exp $

* @file
* The PHP page that serves all page requests on a Drupal installation.
* The routines here dispatch control to the appropriate handler, which then
* prints the appropriate page.

require_once './includes/bootstrap.inc';

$return = menu_execute_active_handler();

// Menu status constants are integers; page content is a string.
if (is_int($return)) {
switch ($return) {
elseif (isset($return)) {
// Print any value (including an empty string) except NULL or undefined:
print theme('page', $return);



Any idea what how can I correct this? The site is still working on the old hosting server. Thank you for your help.

jroque’s picture

Please see http://drupal.org/node/1299298.

Thank you.