[drupal-support] multiple sites

William Meertens nuke at meewi.be
Wed Jun 15 21:57:45 UTC 2005


Hi there,

Yes that's the correct way. I have 8 sites and 6 sub-sites using the same database and in several cases the same prefix. But you have to watch it. Some tables are linked, that is Drupal gets data from more then one table at ones. So when you do it like you are saying and import the complete database with renamed prefix then you will have no problem.

Pay attention that if you include modules later. You have to rename there table prefix as well before you import the sql file. Or you have to change your settings file so Drupal finds your new model if the model uses a database.

Second hint. You do not always have to load a second prefix database for a second site. If your sites are not that much of a difference you can also use the option to change the variables in your settings file. See the bottom of that file. That way you can keep your database to a minimum and share more tables.

But the first option is the most secure one so you not end up having troubles or errors. While the second option includes more testing and trying what works and what doesn't.

Cheers,
William.

On Wed, 15 Jun 2005 17:00:39 -0400
"Christopher Taylor" <christ at bnmc.com> wrote Re: [drupal-support] multiple
sites :

> Greetings-
> 
> Sorry, it is still a little foggy for me.
> Is the following steps going to give me a second fully functioning site?
> A. Change prefixes in the database.mysql file to ba_.
> B. Import tables into database with PHP My Admin using database.mysql.
> C. Create sub directory with the settings.php file in sites directory.
> D. set the $db_prefix in settings.php.
> 
> Is this right or is there another way?
> 
> Thank you.
> Regards
> 
> 
> ----- Original Message ----- 
> From: "Chris Johnson" <chris at tinpixel.com>
> To: <drupal-support at drupal.org>
> Sent: Wednesday, June 15, 2005 4:40 PM
> Subject: Re: [drupal-support] multiple sites
> 
> 
> > Christopher Taylor wrote:
> > > Hello,
> > >
> > > If I want to host multiple sites and I change the $db_prefix in a new
> > > settings.php file, do I have to re-import tables with the new prefix or
> > > does drupal figure it out?
> > > What about aded modules and other additions?
> >
> >
> > If you want to prefix your tables so that you can host multiple site,
> avoid
> > conflict with other existing tables from another application in the same
> > database, or share tables between sites, etc., then you have to rename the
> > database tables yourself to match the prefix values you use in the
> $db_prefix
> > variable.  Drupal does not (can not) rename the tables for you.
> >
> > The method by which you rename the tables depends on your situation and
> > database.  In MySQL, you can issue a "RENAME TABLE foo TO bar" statement
> to
> > rename table foo to table bar, for example.  So you do not need to
> re-import
> > tables to do prefixing.
> >
> > Added modules which have added tables will need to have their tables
> renamed
> > as well, *IF* you likewise want to prefix them in $db_prefix, which you
> > probably want to do if you are hosting multiple sites from one database,
> > versus using prefixing for other purposes, e.g. shared tables, avoiding
> name
> > collisions with existing tables, etc.
> >
> > Hope this helps.
> >
> > --
> > Chris Johnson
> >
> > -- 
> > [ Drupal support list | http://lists.drupal.org/ ]
> 


-- 
                           \|/ ____ \|/    _     _             `  _  '
                 ////       @~/ ,. \~@   o' \,=./ `o          -  (_)  -
                (o -)      /_( \__/ )_\     (o o)               '   `
+-----------ooO--(_)--Ooo-----\__U_/----ooO--(_)--Ooo------------------+
http://www.meewi.be                                       SMILE
http://www.ladiescycling.net                       it cost nothing and
http://www.hostinglc.net                           it's beyond price !
------------------------------------------------------------------------



More information about the drupal-support mailing list