This is a simple howto for moving single coded website to a multi-site environment. I had a few White Screens Of Death (WSOD) before I gained the wisdom to write this (and hopefully help others).

the environment.

So, Drupal 7 website is created ( and we would like to take advantage of Drupal's multisite functionality by adding a second site ( that will be using the same libraries, modules and themes as in

Probably on a shared web-hosting and just want to make life easier.

We already know that libraries/modules/themes placed in /sites/all will be used for all websites, and libraries/modules/themes placed in /sites/ will be used by only.

We already know that we should take out (uninstall and delete) any libraries/modules/themes that aren't used in site1 or site2.

The first website is using the primary domain name, which by default points to /public_html. This website domain name is not a site that has a content, it's the 'master site', the 'bearer'. already has content, so we only want to move it from a single setup to a multi-site environment under, within the same hosting provider.

The steps

  • Backup the files and the database
  • Put offline
  • Update Drupal core and all the libraries/modules/themes to their latest releases; both on site1 and site2, so they have the same release number
  • Run database updates on both
  • Create a folder (no www) and place it in the /sites folder of the installation.
    So it looks like this: /public_html/
  • In, change the files directory to /sites/
  • Copy all the libraries, modules and themes that were used in to /sites/all
    ...this is essential: if Drupal (the mysql) has been configured for single use, it will search for the libraries/modules/themes in /sites/all only
  • Copy the /files directory of to /sites/, so it now looks like this: /public_html/sites/
  • Copy settings.php into the folder, so it looks lie this: /public_html/sites/
    Don't change a single word in settings.php
  • In the control panel (od, point to the folder of - in my case, to /public_html
    ...Drupal will do the rest
  • Type in the web-browser and arrive at that is now using the shared codebase of
  • Run just to make sure that all is good.

Disable update checks for (they are enabled for

If a specific module is to be used only for site2,

  • Disable that module in both site1 and site2 and uninstall/delete it.
  • Move the module to /sites/
    So, for admin_menu it looks like this: /public_html/sites/
  • But then checks for updates for should be re-enabled, otherwise one wont be able to see the update to this module. Same for themes and libraries

If an update Drupal from say 7.15 to 7.16 is performed, /update.php needs to run on both site1 and site2 immediately. The same applies to any upgrade of modules or themes.

Security warning: In /admin/reports/updates/settings, one should click "Check for updates of disabled modules and themes", so that modules that are not used on the master Drupal installation (site1) are checked, especially for security updates.
Again, don't keep modules that are not used on any website.


bdornbush’s picture

All the above makes sense to me. The one time I tried to do something like this, I ran into trouble because image files had been linked into nodes as sites/default/files/image.jpg and of curse, Drupal couldn't find them in sites/ I ended up copying all of the image and linked (pdf) files into BOTH sites/default/files and sites/ What would be nice is a script that would go through the nodes of and change the links for files from sites/default/files to sites/

Are there other such gotchas to think about? I am asking because it has come up again for me.

W.M.’s picture

You can do the changes in paths using SQL replace function inside MySQL console or inside PHPmyADMIN.

salijackt’s picture

I was doing well until I got to this part:

In the control panel (od, point to the folder of - in my case, to /public_html
...Drupal will do the rest

I'm not sure what I'm supposed to be doing?

iceph03nix’s picture

You may have figured this out already, but for people who are finding this later, All the domains that will be using the core files need to be pointed at the main drupal root (where the drupal files are extracted to) It's the folder where you will find 'index.php' and 'install.php'

If all your sites are drupal, this will most likely be in the 'public_html' folder on a shared hosting site using cpanel. If you're drupal is set up in a different directory, you'll need to point it there.

ALL of you're domains sharing a drupal core will point to the same place.

francescosciamanna’s picture

I would like to add that: you need also clear session information to prevent cookies runs into conflicts between the single site(old) and the multisite(new).