Best way to duplicate a site (for multi-sites) ??

Events happening in the community are now at Drupal community events on www.drupal.org.
Pazuzu85's picture

Howdy,

I'm still mostly a fledgling to Drupal, but I have a question that The Community might be able to help out with.

I'm setting up a multi-site Drupal installation to handle 72 divisional websites. The master-site has all the proper content, proper configurations, proper links/menus/blocks etc etc, and the other 72 are going to start off with an exact replica of that master site. That is, if i can figure out how to duplicate the master site over and over.

The multi-sites are all in one DB, and use different table prefixes to differentiate themselves (ie: 'master_', 'subsite1_','subsite2_' etc). I already have them sharing a few tables, but nothing crazy.

Any ideas? Can I just copy/paste all of the master tables into new tables and reference them in the settings.php? If i do duplicate the tables, will everything pan out ok or are there other elements to consider? Is there a relatively easy way to duplicate all these 50-some-odd tables? Perhaps there's a script out there that does it already??

Please let me know your thoughts, Community.

Thanks in advance!!!

Comments

Hi Pazuzu85, the other 72

ipsitamishra's picture

Hi Pazuzu85,

the other 72 are going to start off with an exact replica of that master site. That is, if i can figure out how to duplicate the master site over and over.

From your message I could not figure out at what point these 72 websites differ? Are they going to be in different language or they will hold different articles!!

...content, proper configurations, proper links/menus/blocks etc etc ...

If you want to make replica of contents as well, then why you are making copy of same tables again and again. You can simply point to the same database for each of your 72 websites.

Can I just copy/paste all of the master tables into new tables and reference them in the settings.php?

If anytime you think to duplicate a table in the database, then actually you need to *share* that table across all instances.

I feel, you just need to set the $db_prefix correctly in all your settings.php file.

$db_prefix = array(
'default'   => 'subsite1_',
'users'     => 'shared_',
'sessions'  => 'shared_',
'role'      => 'shared_',
'authmap'   => 'shared_',
'sequences' => 'shared_',
'profile_fields' => 'shared_',
'profile_values' => 'shared_',
'users_roles' => 'shared_',
);

In your case you will have a long list of tables with option shared_ , and a few which are unique to each of your sub-sites.

Cheers,
Ipsita

~ Ipsita Mishra

You may find some info

~ Ipsita Mishra

Multisite

Group organizers

Group notifications

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