Hi --

I'm not an experienced Drupal user (though quite familiar with WordPress). A Drupal site was set up by a third party, and I am now responsible for maintaining the thing. A problem I've come across is that all the theme, module, and file data for the site is contained within the folder that has the Drupal code, so whenever there is an update for Drupal available, I have to move that whole folder over to the new Drupal folder and basically do a lot of monkeying around.

What I would *like* to do is have a way of having the entire /sites/ folder in a separate location, so that when I update Drupal I can simply replace the entire Drupal folder without worrying about site-specific files contained within.

I have:

/drupal/
/drupal/sites/

I want:
/drupal/
/sites/

Is there a way to do this? If I do it, is it going to somehow screw up all my modules or whatever? (i.e. any cautions?)

Thanks

Comments

vm’s picture

why monkey around with moving things when you can just leave the folder alone? That's part of the point of putting contrib and custom modules and themes inside the sites folder. delete everything else but the sites folder and you're done.

I suppose you could try to use a symlink but you would still needs folders where you already have them, ie sites/default/

strider72’s picture

"why monkey around with moving things when you can just leave the folder alone?"

FTP is relatively slow. Your way it would be:

1) take site offline
2) upload entire Drupal install
3) run updates
4) put site online

In my case the "active Drupal is a symlink to the specific version.

The way I do it is:
1) Upload entire Drupal install (e.g. /drupal-6-11/ )
2) take site offline
3) create symlink /drupal/ --> /drupal-6-11/
4) run updates
5) put site online

The second method involves *much* less time with the site offline.... *except* that I have to screw around with moving the sites folder from the old Drupal folder to the new one.

If I could relocate /sites/ this wouldn't be a problem -- the entire /drupal/ folder could be replaced with impunity.

I repeat the question -- can it be done?

vm’s picture

actually, I don't upload every file, only files that have changes in them : )

cog.rusty’s picture

Not directly, the site's settings and modules are expected to be under drupal. It can only be done with a "sites" symlink inside drupal's directory, which you will need to add every time.

"FTP is relatively slow"? You are very generous. I wouldn't even consider using a host without ssh access and wget or curl so that I can have a shell script to get and uncompress the files straight from drupal.org.

strider72’s picture

"You are very generous."

Heh. Yeah, well I prefer to understate than overstate. ;-)

Since I use a PHP script to create the new symlink, I may just modify it to also link the sites folder from a different location. Hmmmm.....

cog.rusty’s picture

In a new Drupal 6 package, the sites/ folder contains nothing except a default/default.settings.php file.

You can overwrite that without any problem. It doesn't contain anything specific to your site. Whatever you have under sites/all, under sites/default/modules etc won't be harmed.

Bobby1290’s picture

To facilitate upgrading (especially when you have multiple install bases).
I re-roll the drupal version, removing files/folders I don't want the upgrade to overwrite.

For a minor update (6.10 -> 6.11):
"I removed the .htaccess, sites folder and robots.txt from the extracted new version, and made a new compressed file (zip,tar, etc.) from the new version without those files (I checked that they had not changed in.."
See http://www.bobbymods.com/updated-drupal-611.