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?
Hope you are doing well. Regards Christopher
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
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@tinpixel.com To: drupal-support@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/ ]
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@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@tinpixel.com To: drupal-support@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/ ]
Hi Christopher,
Your list looks right to me, the best thing is to give it a try.
There are a couple of scripts to help with adding the prefix onto table names in database.mysql (and add on module .mysql files), look for 'prefix.sh' under scripts. I also wrote a script in perl to do the same (why I don't know).
If you can set up more than one database on your webserver (for example, one for each site), this is a simpler way to do things than having table prefixes (unless of course you would like to share some database tables between sites). Just edit each settings.php file with the appropriate database settings.
What you probably want to ask yourself is: *What do I want to share (or not share) between the multiple sites?* - database - directory structure (main drupal codebase) - modules - content - users etc.
Drupal can handle sharing various things between sites, in different ways. So stop and think about exactly what you are trying to achieve first, then work out how to do it.
Hope that helps, Ross.
Christopher Taylor wrote:
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
On Wed, 15 Jun 2005, Ross Kendall wrote:
If you can set up more than one database on your webserver (for example, one for each site), this is a simpler way to do things than having table prefixes (unless of course you would like to share some database tables between sites).
Table sharing is possible with different databases, too. User and password need to be the same for both databases for this.
Cheers, Gerhard
Hi, I did all the steps. I aded a sub-directory of "ci" under sites with a settings.php. I aded the settings.php file. I can't pull it up. Does this make the site address ci.example.com or example.com/ci. How do you set this? Sorry, I tried to read the example help text and I just can't make sense of it with my speech system.
Regards
----- Original Message ----- From: "Ross Kendall" drupal@rosskendall.com To: drupal-support@drupal.org Sent: Wednesday, June 15, 2005 6:11 PM Subject: Re: [drupal-support] multiple sites
Hi Christopher,
Your list looks right to me, the best thing is to give it a try.
There are a couple of scripts to help with adding the prefix onto table names in database.mysql (and add on module .mysql files), look for 'prefix.sh' under scripts. I also wrote a script in perl to do the same (why I don't know).
If you can set up more than one database on your webserver (for example, one for each site), this is a simpler way to do things than having table prefixes (unless of course you would like to share some database tables between sites). Just edit each settings.php file with the appropriate database settings.
What you probably want to ask yourself is: *What do I want to share (or not share) between the multiple sites?*
- database
- directory structure (main drupal codebase)
- modules
- content
- users
etc.
Drupal can handle sharing various things between sites, in different ways. So stop and think about exactly what you are trying to achieve first, then work out how to do it.
Hope that helps, Ross.
Christopher Taylor wrote:
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
-- [ Drupal support list | http://lists.drupal.org/ ]
Hi there,
Let's try and put it different :
1st major rule and concern. IS YOUR SECOND DOMAIN ** POINTING ** AT THE FIRST DOMAIN ?
In many cases a normal sub-domain is pointing to a different directory on your server. And therefor not able to reach your Drupal installation. A real (not sub) domain has to have the same DNS and needs to be pointed at the other domain by your server. Not only changing the DNS you need to change your server or domain values as well. Otherwise this domain ends up in a different location as well on your server.
I just started two weeks ago with Drupal. And must say this went with me like a charm. 7 top level domains and 4 sub-domains are running with one Drupal installation and on 2 mysql databases. The install was as simple as copy and paste the guide in the handbook, with changing the domainnames ;-)
In your case I suggest : sites/ci.example.com But be aware your sub-domain installation points that domain to : /ci.example.com if your hosting uses Cpanel, or /subdomains/ci.example.com if your hosting uses Plesk So you really need to look into that before you go any further.
Probably it's one of these two if you did all the rest like it's explained here before and like mentioned in the Handbook. http://drupal.org/node/258
Good luck, William.
On Wed, 15 Jun 2005 18:23:29 -0400 "Christopher Taylor" christ@bnmc.com wrote Re: [drupal-support] multiple sites :
Hi, I did all the steps. I aded a sub-directory of "ci" under sites with a settings.php. I aded the settings.php file. I can't pull it up. Does this make the site address ci.example.com or example.com/ci. How do you set this? Sorry, I tried to read the example help text and I just can't make sense of it with my speech system.
Regards
----- Original Message ----- From: "Ross Kendall" drupal@rosskendall.com To: drupal-support@drupal.org Sent: Wednesday, June 15, 2005 6:11 PM Subject: Re: [drupal-support] multiple sites
Hi Christopher,
Your list looks right to me, the best thing is to give it a try.
There are a couple of scripts to help with adding the prefix onto table names in database.mysql (and add on module .mysql files), look for 'prefix.sh' under scripts. I also wrote a script in perl to do the same (why I don't know).
If you can set up more than one database on your webserver (for example, one for each site), this is a simpler way to do things than having table prefixes (unless of course you would like to share some database tables between sites). Just edit each settings.php file with the appropriate database settings.
What you probably want to ask yourself is: *What do I want to share (or not share) between the multiple sites?*
- database
- directory structure (main drupal codebase)
- modules
- content
- users
etc.
Drupal can handle sharing various things between sites, in different ways. So stop and think about exactly what you are trying to achieve first, then work out how to do it.
Hope that helps, Ross.
Christopher Taylor wrote:
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
-- [ Drupal support list | http://lists.drupal.org/ ]
Hello, I am very sorry to bother everybody.
I am trying to import a dump I made of the database to run multiple sites from the same code and database. I changed the prefix on the tables to ci_ from br_. Now, it acknowedges by saying "6731 instructions inserted". But, nothing but the original 84 dr_ tables show up. Also, I have a constant error of:
PMA Database ... not OK[
A. I exported the table with only "data" and "structure" boxes checked. B. Then, I changed the prefix to ci_ from dr_. C. Then I went to import files and did a import on the file name I made the changes on. D. It acknowledges success but it doesn't show up in the list of tables.
Any thoughts.
Regards
----- Original Message ----- From: "William Meertens" nuke@meewi.be To: drupal-support@drupal.org Sent: Thursday, June 16, 2005 6:55 AM Subject: Re: [drupal-support] multiple sites
Hi there,
Let's try and put it different :
1st major rule and concern. IS YOUR SECOND DOMAIN ** POINTING ** AT THE
FIRST DOMAIN ?
In many cases a normal sub-domain is pointing to a different directory on
your server. And therefor not able to reach your Drupal installation. A real (not sub) domain has to have the same DNS and needs to be pointed at the other domain by your server. Not only changing the DNS you need to change your server or domain values as well. Otherwise this domain ends up in a different location as well on your server.
I just started two weeks ago with Drupal. And must say this went with me
like a charm. 7 top level domains and 4 sub-domains are running with one Drupal installation and on 2 mysql databases. The install was as simple as copy and paste the guide in the handbook, with changing the domainnames ;-)
In your case I suggest : sites/ci.example.com But be aware your sub-domain installation points that domain to : /ci.example.com if your hosting uses Cpanel, or /subdomains/ci.example.com if your hosting uses Plesk So you really need to look into that before you go any further.
Probably it's one of these two if you did all the rest like it's explained
here before and like mentioned in the Handbook.
Good luck, William.
On Wed, 15 Jun 2005 18:23:29 -0400 "Christopher Taylor" christ@bnmc.com wrote Re: [drupal-support] multiple sites :
Hi, I did all the steps. I aded a sub-directory of "ci" under sites with a settings.php. I aded the settings.php file. I can't pull it up. Does this make the site address ci.example.com or example.com/ci. How do you set this? Sorry, I tried to read the example help text and I just can't make sense
of
it with my speech system.
Regards
----- Original Message ----- From: "Ross Kendall" drupal@rosskendall.com To: drupal-support@drupal.org Sent: Wednesday, June 15, 2005 6:11 PM Subject: Re: [drupal-support] multiple sites
Hi Christopher,
Your list looks right to me, the best thing is to give it a try.
There are a couple of scripts to help with adding the prefix onto
table
names in database.mysql (and add on module .mysql files), look for 'prefix.sh' under scripts. I also wrote a script in perl to do the
same
(why I don't know).
If you can set up more than one database on your webserver (for
example,
one for each site), this is a simpler way to do things than having
table
prefixes (unless of course you would like to share some database
tables
between sites). Just edit each settings.php file with the appropriate database settings.
What you probably want to ask yourself is: *What do I want to share (or not share) between the multiple sites?*
- database
- directory structure (main drupal codebase)
- modules
- content
- users
etc.
Drupal can handle sharing various things between sites, in different ways. So stop and think about exactly what you are trying to achieve first, then work out how to do it.
Hope that helps, Ross.
Christopher Taylor wrote:
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
-- [ 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 !
-- [ Drupal support list | http://lists.drupal.org/ ]
Hi there,
I am very sorry to bother everybody.
No bother, when we can help we do. Only I'm afraid you lost me and we can't follow anymore.
A. I exported the table with only "data" and "structure" boxes checked. B. Then, I changed the prefix to ci_ from dr_. C. Then I went to import files and did a import on the file name I made the changes on. D. It acknowledges success but it doesn't show up in the list of tables.
You mentioned before that you use phpMyAdmin. So when you export everything and then change the table prefix with your favourite editor. After which you run it as an SQL you should end up with a database containing double the amount of tables in two different prefixes. At least that is how I did it. For me that was just work of three clicks. Find - change all - run. Normally phpMyAdmin gives you directly after a SQL run a result if it went good or bad. And you see the result directly in your left side listing of tables. If it does not show up, there must have been an error message coming from phpMyAdmin.
Or, perhaps... As I said before. I'm new to Drupal so I include here an old example. Keeping my tables safe ;-) You should change in this case the prefix "nuke" and not "fx". What happens inside a table, you don't alter. Perhaps this is where you went wrong and all your altered tables are inside the other tables.
# # Tabel structuur voor tabel `nuke_FormExpress` #
CREATE TABLE `nuke_FormExpress` ( `fx_form_id` int(10) NOT NULL auto_increment, `fx_form_name` varchar(50) NOT NULL default '', `fx_description` text, `fx_submit_action` text, `fx_success_action` text, `fx_failure_action` text, `fx_onload_action` text, `fx_validation_action` text, `fx_active` tinyint(4) NOT NULL default '0', `fx_language` varchar(30) NOT NULL default '', `fx_input_name_suffix` varchar(30) NOT NULL default '', PRIMARY KEY (`fx_form_id`) ) TYPE=MyISAM AUTO_INCREMENT=5 ;
Hope that was it. If not I relay start to believe we can't follow anymore.
Have fun, William.
Any thoughts.
Regards
----- Original Message ----- From: "William Meertens" nuke@meewi.be To: drupal-support@drupal.org Sent: Thursday, June 16, 2005 6:55 AM Subject: Re: [drupal-support] multiple sites
Hi there,
Let's try and put it different :
1st major rule and concern. IS YOUR SECOND DOMAIN ** POINTING ** AT THE
FIRST DOMAIN ?
In many cases a normal sub-domain is pointing to a different directory on
your server. And therefor not able to reach your Drupal installation. A real (not sub) domain has to have the same DNS and needs to be pointed at the other domain by your server. Not only changing the DNS you need to change your server or domain values as well. Otherwise this domain ends up in a different location as well on your server.
I just started two weeks ago with Drupal. And must say this went with me
like a charm. 7 top level domains and 4 sub-domains are running with one Drupal installation and on 2 mysql databases. The install was as simple as copy and paste the guide in the handbook, with changing the domainnames ;-)
In your case I suggest : sites/ci.example.com But be aware your sub-domain installation points that domain to : /ci.example.com if your hosting uses Cpanel, or /subdomains/ci.example.com if your hosting uses Plesk So you really need to look into that before you go any further.
Probably it's one of these two if you did all the rest like it's explained
here before and like mentioned in the Handbook.
Good luck, William.
On Wed, 15 Jun 2005 18:23:29 -0400 "Christopher Taylor" christ@bnmc.com wrote Re: [drupal-support] multiple sites :
Hi, I did all the steps. I aded a sub-directory of "ci" under sites with a settings.php. I aded the settings.php file. I can't pull it up. Does this make the site address ci.example.com or example.com/ci. How do you set this? Sorry, I tried to read the example help text and I just can't make sense
of
it with my speech system.
Regards
----- Original Message ----- From: "Ross Kendall" drupal@rosskendall.com To: drupal-support@drupal.org Sent: Wednesday, June 15, 2005 6:11 PM Subject: Re: [drupal-support] multiple sites
Hi Christopher,
Your list looks right to me, the best thing is to give it a try.
There are a couple of scripts to help with adding the prefix onto
table
names in database.mysql (and add on module .mysql files), look for 'prefix.sh' under scripts. I also wrote a script in perl to do the
same
(why I don't know).
If you can set up more than one database on your webserver (for
example,
one for each site), this is a simpler way to do things than having
table
prefixes (unless of course you would like to share some database
tables
between sites). Just edit each settings.php file with the appropriate database settings.
What you probably want to ask yourself is: *What do I want to share (or not share) between the multiple sites?*
- database
- directory structure (main drupal codebase)
- modules
- content
- users
etc.
Drupal can handle sharing various things between sites, in different ways. So stop and think about exactly what you are trying to achieve first, then work out how to do it.
Hope that helps, Ross.
Christopher Taylor wrote:
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
-- [ 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 !
-- [ Drupal support list | http://lists.drupal.org/ ]