I have read all the documentation on moving a Drupal site from a subdirectory to the site’s root folder, but I am still having problems.

I have numerous 4.6.x and 4.7.x websites and never had a problem in the past moving theses sites from a subdirectory to the root directory.

Is there something unique with the new Drupal 6.2 version that is making this problem?

Problem
I installed Drupal 6.2 into a website subdirectory named dp using the website’s auto-installer Fantastico.

Everything worked fine and I added content to the site. I am using the default Garland theme.

After finishing adding content, I wanted to move the site from the dp subdirectory to the site’s root folder.

I changed the uncommented $base_url reference in the sites/default/settings.php file from

$base_url = 'http://scvviplounge.com/dp';

to

$base_url = 'http://scvviplounge.com;

I also looked at the sites .htaccess file and found no reference to the website’s domain. Therefore, I did not need to edit the .htaccess file.

I then moved the entire site to the root directory.

When I go to the site, all the links still maintain the path to the dp subdirectory. Plus the theme is not displaying at all.

After reading some forum topics, I then moved the site back to the dp subdirectory and cleared the site’s cache via the Administer menu. Then I moved it back to the root directory.

I am still having the same problem with all the links including the dp subdirectory path and the theme not displaying at all.

Any ideas?

Thanks,

Sam308

Comments

vm’s picture

clear all the DB cache tables

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

Sam308’s picture

Thanks, but...

Which DB cache tables?

Any suggestion on how to do this?

Sam Raheb (Sam308)

eli03’s picture

it's under the site configuration. Home » Administer » Site configuration » Performance
----------
My Drupal site: Philippines Travel - Come and Visit the beautiful Philippine Paradise!

by Busby SEO Challenge

Sam308’s picture

I already cleared the cache (Administer » Site configuration » Performance) as I mentiond in the initial posting of the problem.

Clearing the cache did not help at all.

Sam308

vm’s picture

because it is a fantastico installation, I have no more advice. I can't replicate your problem on a straight drupal.org install of Drupal 6.2, I can move it whereever I want without issue.

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

Sam308’s picture

Issue solved.

Thanks all,

Sam308

dman’s picture

Any chance you could let those fantastico victims that come after you know what you did to solve the problem in future? ;-)

.dan.

-Anti-’s picture

Ignore this.. I said the same thing as dan.

Sam308’s picture

Problem Solved: Moving a Drupal 6.x site from a subdirectory to the root directory

After the automatic Fantastico installation, the settings.php file located in the /sites/default directory was write protected such that I could not overwrite it via an FTP client.

My FTP client did not notify me when I tried to overwrite the settings.php file with the new $base_url changed file.

I thought I uploaded the changed file, but in fact the file overwrite never occurred. I only found this out after I downloaded the settings.php file and noticed that the $base_url change never occured.

I had to change (add) write permission to the settings.php file on the web server in order to successfully overwrite the file with the new file. After that, the site functioned properly.

In summary, I would recommend one performs the following if planning to move a Drupal 6.x installation from a subdirectory to the root directory:

1. Clear all the Database Cache data via the Administer › Site configuration > Performance page. If needed, you can also clear all the Database Cache data / tables via your site’s control panel phpMyAdmin.

This would include the following cache tables:

cache
cache_block
cache_filter
cache_form
cache_menu
cache_page
cache_update

2. Change the write permission of the settings.php file on the web server so you can overwrite it with the new $base_url changed file.

3. Move the entire Drupal installation from the subdirectory to the site’s root directory.

That’s it,

Sam308

dman’s picture

Thanks for the follow-up ;-)

.dan.

strellman’s picture

Thanks! This was helpful for me using a cpanel file manager too. It looked like it copied settings.php but it didn't. I found it better to compress the old /sites then extract it in the new location to keep all the file and subdir attributes.
This is probably relevant to upgrading Drupal core as well.

http://2tell.org/boring

boutrosboutros’s picture

Thanks for the follow up Sam. Saved us all hours of stuffing around.

izmeez’s picture

This sounds like a thread that may apply to a problem I am having that I described in a recent post http://drupal.org/node/312383 and that I am still trying to resolve. Any help would be appreciated.

Briefly, I did not empty my cache at the time I copied my database to a new database and moved the site from sites/default to sites/test.example.com with all sub-folders including the files folder. I have cleared the cache several times since but maybe that is a critical step.

The Garland theme with custom colors was in use but initially does not show up. If I go to Administer>themes>configure the custom color settings are shown and when I click save it creates a new color file and the theme works fine. It does not appear to recognize the existing color folder for the theme.

Also, nodes that reference images that are in the files folder which has now been moved along with all the other sub-folders do not show up and neither do user pictures contained within the pictures sub-folder.

I tried changing $base_url $base_url = http://test.example.com even though I was not sure from the examples if such a $base_url is permitted and there was no change. The problem persists.

I read a bit about rewrite base in reference to the location of the Drupal codebase and wondered about changing that since my codebase is now in a new sub-folder called Dtest. Is that the way to solve my problem or do I need to do something else? Any suggestions would be welcome.

Thanks,

Izzy

bmeier’s picture

I followed the steps and had a correct front page but no working links. Then I found a line in .htaccess which I had added on install:

RewriteBase /drupal

I changed this to "RewriteBase /" and now the site works correctly.

baxterjones’s picture

hi,
thanx for all the suggestions at the top, but i am still not able to access my drupal site.
the scenario: i developed the site on my demo server and then moved it by zipping the files from the server, then i exported the database to a file. after that i basically reversed the procedure taking care that all tables are imported to the database.

now i can't login, but what i find strange is that if i type my username and pass correctly the page reloads and nothing happens. but when i type my password incorrectly i get a "the password and username is incorrect", now does this mean it's still reading the information as correct, i just don't get verified?

if anyone has a suggestion i am willing to try all, really desperate at this time :(

miahmiah900’s picture

That login thing happened to me when I broke the .htaccess RewriteBase, did you check that already?

cgjohnson’s picture

any update on this?