Move modules from /multisite to /all

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
no2e's picture

In my multi-site setup, I want to install only "finished" releases (so: no dev version, no beta, etc.) to /sites/all/modules.

So when I install a dev version to my multi-site /sites/example.com/modules, and this module will get a release later, I want to move it to /sites/all/modules.

Does this work without any problems? Anything to mind?

Would I need to update the module at the multi-site first, before deleting it and re-install it in /sites/all/modules?

Comments

There could be odd side

Garrett Albright's picture

There could be odd side effects if a module has cached or saved a variable with the "old path" in it, but that's probably unlikely. Go ahead and move the module, and if you encounter any problems, just try flushing your cache, or the Nuclear Option; disable and uninstall the module, then reinstall it. (Back up your data first if you go that route!)

That's actually pretty

ixlr8's picture

That's actually pretty likely. All modules' locations are stored in the db. If you just move it, you'll have to update it in the database. Also keep in mind that there is a hierarchy that Drupal will follow for multiple instances of a module. If follows a pattern something like this:

/sites/mysite/modules
/sites/all/modules
/modules

... meaning, that a particular module version can get potentially overridden by a different version of itself. There are a bunch of things to look out for in this, but basically, you might be using a version of a module that isn't what you want, or what Drupal expects (ESPECIALLY if there are db changes between versions). That can lead to even more unexpected behavior that will be rather unpleasant.

Not to say that this is impossible, but you have to watch it very very carefully.

Mike

Update?

no2e's picture

If you just move it, you'll have to update it in the database.

Update via Drupals update.php or do you mean something different?

You'll have to physically go

ixlr8's picture

You'll have to physically go into the database and change where it tells drupal to find the module. I believe it's in the system table.

Ohh.

no2e's picture

Ohh, mhh - never did something like this before. And I don't wanna start with it by "fiddling" around.

What is your modules strategy?
Which models go to default, which to the site specific directories?
What happens, when you installed a module in site directory 1 and you need it in site directory 2, now too? Do you go with 2 "editions" of the same module, or do you transfer it to default directory?

Modules don't go in default.

ixlr8's picture

Modules don't go in default. If you want a module to be available to all of your multisites it should go in /sites/all/modules. I generally even also go one layer deeper and make two folders, one for contributed modules and another for custom modules. If, on the other hand, you want a module to be available to only one of your sites, it goes into the /sites/sitename folder of the site you want it to be available to.

Generally speaking, its better to put your modules in /sites/all/modules, so that you don't run into that issue of "now i want this available to a new site, but it's in a site specific folder," unless you have a really good reason for wanting a module to not be available to one or more sites. But that's an entirely different discussion.

dev vs. releae version

no2e's picture

(Oops, correct - mixed up the names, but mean the correct one.)

unless you have a really good reason for wanting a module to not be available to one or more sites. But that's an entirely different discussion.

That's not the case for me (I'm the only admin of all multi-sites). But I wonder:
when I build a feature with a module, which is still in dev, I "assume", that some of the modules' function might be removed in the release version. So, when I'd upgrade the dev-module, I'd possibly lose some of the needed functionality (or something might not work the way I implemented it, whatever).
But maybe I need the release version of this module for an other site.

So I thought, that it would be saver, to only install "finished" release versions to sites/all, and install dev-version to site specific folders only.

But that's a scenario only, never run into this situation before.

Well, I'm not really sure

ixlr8's picture

Well, I'm not really sure why your release would have less functionality than your dev version. Why develop a functionality that doesn't belong in your module? If it's something you need, and it's inappropriate for it to be in the module you're writing, then perhaps it should be in a separate module that hooks into and extends your release module.

What can I do after moving the modules?

elianarunner's picture

I noticed quite late that I had to install the modules in sites all and not in mysite and abruptly decided to move them to the right location using eclypse. The site started to have strange updates and I was getting a problem with a module Advance forums so I turn off this module at admin > modules. Know my page doesn't load at all and reports a database error. When I try to replace with my last commits in eclypse, it says an error has occured in discarding changes due to advance forum change log.

What do you recommend to do? Do I have to reinstall core? What is the less loss possible solution?

Thank you for any contribution!

separate issue

no2e's picture

I see you already posted a separate issue: → http://drupal.org/node/1891576

Issue still not solved

elianarunner's picture

I guess my issue is related to this post. It is the first time I post an issue and would appreciate help to go on.

have you tried to move the

J-3P0's picture

have you tried to move the modules back to the original location?

Also check your file permissions on the server for the modules

Drupal keeps a registry of

patrickavella's picture

Drupal keeps a registry of module locations that can be difficult to diagnose as the problem since Drush CC doesn't clear it.

http://drupal.org/project/registry_rebuild

Make sure you have this module available for drush. Then move your modules to the all folder, and run drush rr, this will clear up the path issues that normally arise when moving modules around.

Thanks,
Patrick

I only have access to the database through eclipse

elianarunner's picture

Hey Thanks for the answers!

I only have access to the database through Eclipse. I cannot access directly the server because is the server of my client (a university), so I don't have drush running on this project. Would it be possible to just copy the whole project to my computer to backup and rebuild the registry manually as they explain in your link?

System Table

rCharles's picture

Try editing relevant module paths in the system table after a move of modules but check and Drural hasn't done it automatically first. If you need to edit manually for many sites consider a MySQL SCRIPT. Just th lights not tested.

I don't really understand what you mean

elianarunner's picture

Sorry I am not really a backend developer. What do you mean by editing module paths?

Here is an image of what happened.

http://s13.postimage.org/6g3ysficn/db_eclipse_error.jpg

Multisite

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: