Moving Drupal
Ear Drops #3
In this drop I talk through the steps required to move your Drupal site from one domain to another.
The Steps
- Take your site offline.
- Download the entire site to a local directory.
- Export the site database to a local directory.
- Create a new MySQL database if necessary
- Edit sites/default/settings.php if moving to new database.
- Upload site files to new domain. Don't forget .htaccess.
- Login and test.
- Bring site back online.
Your comments and feedback are welcome.
- learnbythedrop's blog
- Login to post comments
- 18712 reads

Comments
404 not found error when moving my site
Hi Rob,
I followed those steps one by one, is just that i have a different situation, i have a server with a web page, this web page is html basic... it is all in the httpdocs folder. So for testing pourposes i created a folder called drupal test... so it looks like this> www.website.com/drupaltest
So i uploaded the files over there, then restored my database, then changed the settings file.
But when i type the address into the web browser it rises the 404 error.
My question is, what did i missed? is it that i need to create a subdomain to point to the new address?
thanks
check htaccess file
The times when I've seen 404 messages there have been problems with the .htaccess file which is in the root Drupal directory. Check the web server side to see if the .htaccess file is there. You may have to check an option in your FTP utility to "show hidden files" in order to see it. One of the problems is that by default some FTP editors hide that file.
If you check your web server folder and the .htaccess file is not there then you should locate it on your localhost and upload it. It's possible that your local machine was hiding it as well, in which case you will need to unhide it in order to upload. On Windows for example to unhide files while in the directory you would choose Tools => Folder Options => View => Show Hidden Files and Folders.
Re: check htaccess file
I´ve forgotten to copy the ".htaccess" file. Thx! Helped for me
this link is broken
Hi,I am also having problems on the installation process on the domain, i followed your steps but i get "thi link is broken" and the google logo next to it. Any idea?
thanks
It's A Website Issue
If you're getting a message saying that the link is broken then I suggest that you check first to make sure that the files you uploaded are to the correct location on your server.
I agree with you
I've been testing my site in many ways and sometimes it appears "drupal - this site iss offline" and depending on what i write on settings.php it changes to "this link is broken". I think i wrote the right thing on settings.php (username:password/host/databasename), I might give the hosting a call to check this though...
Thanks for showing me a light at the end of the tunel, : )
Trying to migrate site from the web to localhost
Rob,
I have done these steps in order to download my website to my computer so that I can play with it on localhost.
ftp all files to my c:/drive
edited my setting.php file
created new database
imported data via bigdump (too big for phpmyadmin)
downloaded all extra modules and put in sites/all.
run update.php
At this point when I go to test drive the site I only see the primary links, no theme, no blocks and the login is not working.
Any suggestions. Big newbie here.
Thanks
Localhost Migration
The first thing I would do is check to see if everything is in the right place. Contrib themes should be in /sites/all/themes and contrib modules should be in sites/all/modules. You may have done that already but it's always worth it to double check. Also check to see that you have the .htaccess locally on your hard drive in the root of the Drupal directory. Sometimes that file is hidden in FTP programs and doesn't get downloaded.
Thanks for the tutorial. The
Thanks for the tutorial. The problem I am having is with moving a large database. I am moving the site from a live Linux host to a local Windows / XAMPP environment. Phpmyadmin cannot handle the 39Mb sql dump file. Command line approaches are not an option because Cygwin does not have MySQL support. I have tried a script bigdump.php and it is also failing.
I know I can clear my cache tables on the live site with Phpmyadmin, but I see that as a last resort. I don't want to wreck my live site without having a functional way to restore it.
Any ideas?
I solved my problem. This may
I solved my problem. This may be useful for others out there. I first exported my live site database by unchecking "Data" in Phpmyadmin and exported the database. I then imported that database locally, structure only. Then on the live site I checked "Data" in Phpmyadmin, then deselected any table named "cache" or starting with "cache_" and exported the database. The .sql file was much smaller. I then imported that file locally and the site is working, error free and in the exact same state it was in on the server.
There may be a better way to do a remote Linux web server --> local Windows XAMPP large database transfer, but I'm just happy I finally got it to work.
Transfer database
Man,
I follow the steps in this web :http://drupal.org/node/120630, but I get very big file. Therefore, I cannot manage to import dabase to my localhost phpmyadmin. The maximum large that allow is only 2,048 KB.
Even I try to compress the database to format gzipped, I could only get 3,800KB.
I want to do the same thing like you, but I did not see any any name start with "cache" in phpmyadmin.
For infomation: I would like to transfer from remote Linux web server --> local Windows Wampserver.
Is there any other way? Please guide me. Thank you.
Missing Modules and Corresponding Database Tables
Does one need to install all the modules first before getting the old database ported over? I mean to say, if the new Drupal install doesnt have all the modules from the old site, will the tables that those modules call up get corrupted or cause Drupal as a whole to be confused?
Drupal needs the "core"
Drupal needs the "core" modules and tables to function at a basic level. The contributed modules are not necessarily needed but you will lose all of the functionality that those modules had added so your site may not be usable if you're relying on those contributed modules. The data from the contributed modules will still be in the database but they shouldn't become corrupted since you can't write any data to them without the modules being present.
My main question would be this. Why would you move the site without moving the contributed modules?
To clarify, I do intend to
To clarify, I do intend to install the modules on the other side. Thats not in question. I just simply was trying to determine the Order of Operations in doing so. I didnt know if I needed to either:
a) Perform the fresh drupal install, install all the non-core modules that were on the live site, and THEN import the db.
OR
b) Create sql database, import the database, do a fresh Drupal install and point it to this new database, THEN install the non-core modules.
I think it's important to
I think it's important to define what "install" means with respect to Drupal. On the one hand we have files located on a web server somewhere. On the other hand we have a database waiting to be populated. What the install process does is connect the files to the database and create the appropriate tables. When you're moving you're site you've already performed the install so you shouldn't have to do that again.
You take your local files and upload them to a webserver. If the files aren't local then you're just moving them to a new location. Then you create an empty database on your webserver. You export your local database tables for Drupal and import those tables to your new database. So now you've got the right pieces in place you just need to connect the files to the database.
Your settings.php file contains the information that points your Drupal files to your database. So you edit the settings.php to point to the right database. If you're database hasn't moved then you shouldn't have to edit your settings.php file.
Exactly what I was saying,
Exactly what I was saying, yes. I just wanted to make sure I didnt go out of order. Basically the site is already live but Im re-enacting a copy here on my localhost (LAMP) I did not have any Drupal sites installed on localhost before I started on this project, but as you say, I know that a clean install is always best anyway.
Thanks!
Additional Clarification
After posting my previous reply I read the question again and I thought my first answer really wasn't too clear. So here's some clarification.
You don't need to "reinstall" any modules that were installed before you moved the site. The database that you will export and import to the new location knows what's installed. So when you make that move you will fill an empty space (the new database)with the tables from the database that you are moving. Then you will move all the files from the original site to the new location and point your settings to the new location of the database.
So you're not really installing Drupal again. You're just moving what you have from one location to another.
I installed Drupal 6 and am a
I installed Drupal 6 and am a new user. I am going through lesson five and from what I have read and learned on the Lesson 5 video, Drupal comes standard with "Page", "Blog", and "Story" content types. I installed the correct version of Drupal 6 but I only have "blog" and "forum". What am I doing wrong? Do I need to install a module?
Page Content Type
You shouldn't have a forum content type unless you have enabled the forum module. Forum is a core module (comes with the standard install) but is not enabled by default. The page content type should also be there without any additional modules. If you haven't been doing any configuration or editing content types then this situation would be very curious to me.
You have a couple of options. You can restore a backup (if you have one) and see if the "page" content type reappears. Or you can use the core features to add a new content (/admin/content/types/add type), call it what you like and give it the attributes of a page. The main difference on a page type is that you might not want to enable comments and you might not want to have it promoted to the front page when you create it.
Thanks for your response.
Thanks for your response. Would you mind walking me through what the attributes of a "page" are so I can setup the page. I am trying to create some static content. Thanks.
I transfer drupal from one domain to other
Hi!
First thanks for all your tutorials, those have been very helpful to me.
I followed your instructions on transfering the site, edited the settings.php import the database, uploaded all files and I am getting this:
Forbidden
You don't have permission to access / on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.7a Phusion_Passenger/2.1.3 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at imodelcasting.com Port 80
So I really don't know how to fix this. What is your point of view? thanks
First, I would check to see
First, I would check to see if the .htaccess file has been transferred over. Sometimes the file is hidden and doesn't get transferred because of that. A missing .htaccess file will cause problems. Second I would check the server configuration. Have you run a Drupal site on this server before? How you handle it depends on whether it's your own server or a shared hosting account. If it's a shared hosting account then check with your host's support to see if there are any issues with Drupal. If it's your own server then it's likely that you know more about the configuration of Apache and PHP.
file host transfer
registered the domain name in yahoo and is stored in another host. how would i set the domain name and appear as is, say (abc.com), when redirected should appear as abc.com not xyz.com.
you advise is highly appreciated.
thanks
Nameserver Change
I think what you want to do is point the domain in question to the nameserver of your webhost. I currently have my domains registered via one company and hosted by another. What I do is add the domain to my web host from their control panel. Then I must go to my domain registrar control panel and change the nameservers from the ones used by my registrar to the one used by my host. Within a few hours the domain should point at where your files are hosted.
Still bamboozled by .sql
Hiya,
I am a greenie trying to upload the.sql file to the webserver on shared hosting(its an add on domain).it gave an error because the file size was big and also maybe because the collation was wrong?(it says utf 8 on the webserver and in my file it is latin1_swedish-ci;So the part i am struggling with is how to import a sql file onto shared hosting also when you create a new database(for the add on domain) called bob on the server the name is something like "example_bob" then i don't know if this is a problem too.I wish for help on uploading the sql file to the webserver.What is the best way for a beginner who has no wish to fiddle with things like bigdump etc.I just would like to be able to import this file into phpmyadmin.i don't know how to empty cache files and do the database names matter?Thanks.
Importing Large SQL Files
The fix for the oversized sql file should be an easy one. phpMyAdmin allows you to export and import your database as a zip file. Those zips usually turn out to be pretty small and that will allow you to upload your database.
Changing the name of the database on the web side is not a problem. You just need to update the location, name and password for the database in the settings.php file and upload it to the web server. Then Drupal knows where to look for your database.
Thank you so much for your
Thank you so much for your advice and kindness.really appreciate that...
.htaccess file & 404 Error
Hi there:
I migrated my site and have been encoutering 404 Error. I checked my process against what you listed above and in the string of comments here but I am still having problems.
1) My .htaccess file is located on the server. It is located here on my server: /sites/default/files/.htaccess.
2) I read on another site that possibly the .htaccess file needs to be modified in some way but I have no idea if that is the right thing do to. I have cut/pasted below the contents of my .htaccess file:
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Options None
Options +FollowSymLinks
3) Also on the drupal.org site, there were comments about testing to see if typing the url in the browser in this way to bypass the .htaccess file:
http://www.domain.com/?q=user
I did that as well and I can actually access the page but once again, selecting any links or trying to go any further yields the 404 error.
Do these clues give you any idea what is happening? Can you help? What am I suppose to do now given my continued problems?
htaccess file location
I've never had to modify the .htaccess file just to get a Drupal site running so I doubt that is the issue. I always place it in the root directory so perhaps you should try moving the file to the root directory and see what happens.
Re: Moving Drupal
Yep Stupid me
I did all the steps :
1. Take your site offline.
2. Download the entire site to a local directory.
3. Export the site database to a local directory.
4. Create a new MySQL database if necessary
5. Edit sites/default/settings.php if moving to new database.
6. Upload site files to new domain. Don't forget .htaccess.
7. Login and test.
8. Bring site back online.
EXCEPT FOR the end bit to # 6 (Don't forget .htaccess)
i did forget it and got alot of 404 errors ,... ........
SO please remember And Don't forget .htaccess
Thanks
Re: Moving Drupal
I have a small request. Could you share some insight on moving a Drupal install from a sub-directory to the root? I've found some articles on it on the web and Drupal.org but wondering if you could share a video? If not, then that's okay too.
Thanks!
Re: Moving Drupal
Great! I was moving the install from one dir to another, an for w/e reason the .htaccess had not copied, so I was getting 404 errors for everything but the landing page. Thanks!
Re: how to retrieve data from database to a web server
hi..
i ve created a site using drupal.i ve a database in phpmyadmin. pls tel me how do i retrieve data stored in database to my site without using html.. pls do reply as soon as possible
Re: how to retrieve data from database to a web server
Your question: "pls tel me how do i retrieve data stored in database to my site without using html".
I need a more specific question in order to help. How did the data get into the database in the first place? If it was entered via the Drupal create content form then you can use the Views module to create lists and pages with that data. If the data was migrated from another source directly to the database then you can use the data module in conjunction with Views to display the data.
Re: Moving Drupal
Hi,
I just moved a copy of Drupal to another subdomain to have a preprod environment.
Everything is fine, the new database installed, the homepage is Ok. But all the links are still pointing to the old subdomain!
I can access pages (front & admin) using ?q=... or /node/... but all the links are still pointing to the old subdomain.
I looked at the url_alias table and all the aliases are independant of the domain
The base_url parameter wasn't defined in my settings file. but I tried to uncomment it and point it to the new domain, and it doesn't change anything.
I disabled and re-enabled clean-urls. Same...
Any idea ?
Thx in advance !
Re: Moving Drupal
Did you move the .htaccess file? It sounds like an htaccess problem to me.
Re: Moving Drupal
Sure I did.
If there wasn't a .htaccess file, no reason the links point to the old domain...
Re: Moving Drupal
So, I've tried moving my drupal install to a new host.
Moved the Drupal files to the new site (including .htaccess), imported the database and I'm now getting a 500 error on the landing page after a few seconds of loading. (Starting to smell like a problem on the service provider's end. Can't handle big databases (sql file is almost 17mb unpacked) or something...?)
How this differs from most of the earlier issues stated in this thread is that as opposed to the links and nodes bringing up a 404, I can't seem to get even the main page of the site to work. This makes it rather difficult to try and figure out since I can't even get to the admin page :)
A clean install works aside from HTTP request status failing (which will end up being an issue since the site has feed aggregators). Could this be a reason for the main page not loading at all?
Seems the site works as long as I have the clean database from a clean install (with no real content aside from themes, of course). As soon as I import the old database, the page will no longer load and will instead return a 500 error.
Any general tips for fixing this?
Re: Moving Drupal
Check with your ISP to see if they can look into memory issues. I say that because the only times I've experienced 500 server errors was when my private server did not have enough memory allocated.