how to: merging two existing drupal sites

TheFazz - December 16, 2007 - 03:26

i am planning to merge two drupal sites. however, i wish to maintain a single users table (shared).

i did a bit of a search and came across the following: http://drupal.org/node/45315

i have also done reading on setting up multiple sites with single code base, database etc, and have successfully done so. but these were all new sites.

however, i now need to expand on the topic a little which concerns with broadly merging two existing sites.

my merge plan

the mode of merge will be to run the two sites as separate sites, sharing a single drupal code and a single mysql database.

to do this, i plan to prefix all the tables for these two sites. Each site will have a unique prefix, except for the users, sessions and sequences tables.

the users, sessions and sequences tables will have a shared prefix.

merging the sequences tables is easy as this is simply a running number list for various items in each site. for sessions, i don't think this is a major issue as this only controls the login status of users.

what scares me is merging the two existing "users" tables. mainly because:

1. some users may exist on both sites - but with different IDs - which means the UID (user ID) linkage to the NID (node ID) will be affected. having said that, i would still like to explore if neither users (except for a known handful) are common on both sites.

2. whilst the field structures look the same, i am concerned about the field "data" - which seems to be cryptically an access type field to define user settings.... i need help here.

for the rest of the other fields, this is my plan:
uid - increase the UID numbers for one table by the numbers of users in the other (in other words, sequence one users table as if they came after the other users table)

name - no issue here (keep same)
pass - no issue here (keep same)
mail - no issue here (keep same)
mode - no issue here (keep same)
sort - no issue here (keep same)
threshold - no issue here (keep same)
theme - no issue here (keep same)
signature - no issue here (keep same)
created - no issue here (keep same)
access - no issue here (keep same)
login - no issue here (keep same)
status - no issue here (keep same)
timezone - no issue here (keep same)
language - no issue here (keep same)
picture - delete (users to reload avatars)
init - no issue here (keep same)
data - HELP NEEDED
timezone_id - no issue here (keep same)
name_length - no issue here (keep same)

looking forward to some help, advice and cautionary notices. thanks in advance.

fazz

immediately... help me explain the "data" field

TheFazz - December 16, 2007 - 03:43

i need help to immediately understand the "data" field items. any help?

any help here?

TheFazz - January 5, 2008 - 04:57

any help here?

also if i need to merge the content (nodes & CCK) from these two sites... how do i do it?

modules: i use mainly the CCK & views modules, some input filters (like table filters, quote, bbcode), some javascript modules, userpoints, organic groups

except for CCK, views and organic groups, the rest are minor modules.

Hello, I've checked your site

TheoRichel - February 22, 2008 - 12:40

'The fazz' and though I am not the least bit interested in karting I liked the design very much, really beautiful! The reason to get here was that I have been doing something similar: creating a multisite with some shared tables ( http://drupal.org/node/225015 ). I would like to know: how have you finally managed to merge these user tables? Did you simply import one into the other with PHPmyadmin? And is the user table the only table that needs to be merged?
I hope to hear from you, thanks

Theo Richel
www.richel.org/resume
www.groenerekenkamer.nl
www.klimatosoof.nl

TheoRichel - thanks for the

TheFazz - February 23, 2008 - 09:22

TheoRichel - thanks for the compliment. i tend to experiment a bit and try to improve on usability as i go along.

i had merge all the shared tables such as users, sequences and sessions. but those were fairly straightforward. in all instances the merging exercises were manual ones. i had to export and then import the relevent sql instructions from and to the new tables.

my main challenge was merging the user tables. as both sites were not new, and hence already had some registered users. some users were common on both sites, whilst most were not. i had to manually identify the common users and manually change the user tables and node tables (uid's had to change as well) accordingly. it was a slow process, but i eventually got it done.

fazz

http://www.my-kart.org/

 
 

Drupal is a registered trademark of Dries Buytaert.