By CrowChick on
Not too long ago, I helped a friend with a Drupal installation in a subdirectory on a site. Then they wanted it in their main directory. So I copied all of it and moved its files to the main directory, even did a sitewide find and replace to change the folder location in any random files/modules. Alas, while the front page is showing up perfectly absolutely none of the links work. They all take me to a black page. No HTML, no error, nothing.
I feel like something was broken in the move, but I'm just not familiar enough with Drupal to know what it is. Any advice you might have is so very appreciated :)
Comments
=-=
you shoudln't have had to change the location in "any" files as drupal is relative to its index.php as are all files. That said, whatever changes you made to files should be reversed.
with regards to links:
check settings.php to ensure that the $base_url is set correctly.
There was a particular
There was a particular module that required a base directory path. (Gallery2 integration, specifically.) There were no changes made to the core files that I know of.
Taking your advice...
I uncommented and implemented the $base_url
The main page still shows, but now when I try to click any of the links, login, pages, what have you, I receive an internal server error.
=-=
if $base_url wasn't set while it was in a subdirectory, you can leave it commented out.
hover over a link, inspect the url path. see anything out of the ordinary?
if you remove the .htaccess file from your installation anything change?
blank pages are apache/httpd errors have you checked your apache error logs?
Reading this thread, I don't
Reading this thread, I don't have a clue what you've done so far, so my advice has to start like this:
· revert back to the 'subfolder website' before you did anything to it. This means deleting the broken website in root (assuming you still have the original website files in the subfolder), and importing a previously backed-up database. Once you have got back to where you were before you started trying to migrate, read on...
> even did a sitewide find and replace to change the folder location in any random files/modules
It isn't clear what you mean. I hope it means you intend to:
· dump the database to desktop
· copy it (you need a backup in case you mess up)
· use notepad to search the copy of the dump for the string: /[subfolderName]/sites/
· and replace it with /sites/
· (these previous two instructions assume that your 'file system' path is: sites/default/files)
· save the database dump with 'utf-8 without BOM' encoding
· drop the tables in the remote database and import the edited version
· Note you do not change any paths hard-coded into drupal files; only the database dump is searched.
· DO NOT visit the subfolder site - it is now broken.
· back-up any important files in root, such as htaccess and robots.txt (there might not be any).
· copy all the files from the drupal subfolder site to root.
· check the htaccess file and settings.php to ensure they reflect the correct path, if any.
· visit the root website - if it is working, backup the subfolder files and then delete the subfolder.
· it is important that once the root is copied that you do not visit or use the subfolder website at all.
· you also need to change the cron job to reflect the new location
In future, try not use subfolders for your websites. If you use subdomains instead, then you can move the site to root or another subdomain without editing the database.