I'm curious how to go about creating multiple sites now with Drupal 5.0. Once installation is complete, install.php is deleted from the server. Understandable security risk taken care of. But now I want another site on this same Drupal installation and am scared to go re-uploading the install script and running it on the subdomain I specified. I never thought installation was difficult before, so I went to just grab the database schema to install manually and found it flew the coop. What am I to do here?

Comments

kkaefer’s picture

Read the "Multisite configuration" part in your INSTALL.txt. It's all explained there.

Gman’s picture

The install.txt files has all the info about the sites folder needs, but not so much on the database needs.

If you are sharing all aspects of the database, then you don't need to do anything else besides what is in the install.txt, but if you are, then you will need to export your table, and reimport it into a different database, or back into the same database after you have updated the table names.

But due to the new install systems, there is no set db schema like in previous versions.

pwolanin’s picture

I assume you are only using the available (alpha) version of 5.0 for testing?

Anyhow, I'm not sure the above is correct. One thing with multiple sites (as I understand it), is that settings.php needs to be moved from /sites/default to /sites/mysite.

Probably what I'd try is this:

make a copy of the initial settings.php file. Install one site with a unique databse or table prefix. Move the settings.php file to /sites/mysite1, copy the inital settings.php file back to /sites/default, run the install script again and move settings.php to sites/mysite2, etc.

---
Work: BioRAFT

rszrama’s picture

Thanks for the replies guys, but they didn't really hit on the problem. I know all about setting up Drupal to run multiple sites w/ different settings directories and such. It's just that each site ought to have its own database, and right now the only way to accomplish a second "clean" site on an installation is to copy the database from the original installation and dump the junk out of it. Unless I'm really missing something. The multiple sites part of INSTALL.txt is fine and dandy for the settings files (the same as it's been since I've been using Drupal), but it says nothing about this apparent oversight... there's no way (w/o a database schema file like we had before) to setup multiple Drupal site databases right now.

Maybe I'm just missing something commented somewhere else...

----------------------
Current Drupal project: http://www.ubercart.org

pwolanin’s picture

In the method I suggested, you should be able to type in a different database name each time you run the install script, right?

Also, you might consider posting this as an issue and/or e-mailing the devel list. Since 5.0 is still a ways from being released, the documentation is still obviously lagging a lot, and some aspects (like this) may change.

---
Work: BioRAFT

eetdcob’s picture

As of today the documentation still doesn't explain it.
I'm not sure how to install the second site & concerned that my efforts will clobber the first site.

I have control over virtual hosts & databases, can do what I like. Have set up a database for the second site but not sure how to populate it -- maybe I'll try copying & revising the first one.
But since virtual hosts all point to the root Drupal folder, and it's apparently Drupal's job to resolve the sites, how will this happen?

Thanks for any thoughts.

pwolanin’s picture

d------’s picture

Hi all,

I was trying hard to find a solution to this problem. My specific needs were to run multiple Drupal sites on one Windows webserver, based on one drupal site I had already set up and configured to act as a template for the next Drupal sites.

I came up with my own solution in the end...

create a new text document and save it as drupal_duplicate.bat with the following text inside...

cls
cd c:
@ECHO OFF
cls
echo This program will create a copy of the Drupal MySQL Database for you...
echo (Press Ctrl+C to quit)
pause
mysqldump -ufake -pnotreal database_name > copy.sql
echo before continuing to next step make sure new empty database exists to copy the data into!!!
pause
mysql -ufake -pnotreal new_database < copy.sql
del copy.sql
exit

replace the username and passwords and database names with your real ones, save and then run the file. It will save you alot of headache on the command line if you dont like that kind of thing.

Next simply copy your entire Drupal site to the new website folder, open up settings.php and add in the correct base URL and change the database names to match the correct new database.

Thats it all done!

I will upload an updated version of the batch file which can promt you with the username, password and database names so you wont need to edit any files at all. I will also get it to copy and edit the drupal site and files automatically too when i get a chance.

If anyone is interested in contributing a Linux shell script version then please email me!

Good luck!