Posted by ergonlogic on September 2, 2010 at 4:41pm
Jump to:
| Project: | Hostmaster (Aegir) |
| Version: | 6.x-0.4-alpha3 |
| Component: | Documentation |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
First, and most importantly:
(11:44:55 AM) vertice: [...] we dont really support shared tables =P
But if you're stuck needing to import existing sites that are using shared/prefixed tables, some of the advice below may help:
(12:09:53 AM) ergonlogic: has anyone here ever imported a site with shared user tables?
(12:10:11 AM) ergonlogic: any gotchas I should be aware of?
(12:13:25 AM) omega8cc: ergonlogic: it is possible to import and run (migrate etc) sites with shared originally tables but you have to clone the same database for every site and effectively split them, since Aegir requires each site to have its own db
(12:14:25 AM) ergonlogic: omega8cc: thanks, that's what I was thinking
(12:14:44 AM) omega8cc: ergonlogic: so to have prefixes working you would need to use custom included php file for every settings.php
(12:15:04 AM) omega8cc: to avoid doing that in global.inc
(12:15:19 AM) omega8cc: it is a new feature btw
(12:17:07 AM) ergonlogic: omega8cc: I saw some stuff about that with Domain Access, I believe
...
(12:20:43 AM) omega8cc: ergonlogic: yes, and now you can do that for DA not only on the global.inc level
...
(12:21:35 AM) ergonlogic: is that documented anywhere outside the code, by any chance?
...
(12:23:31 AM) omega8cc: ergonlogic: it is in the commits comments for sure, and in the settings.php
(12:24:22 AM) ergonlogic: thanks, I'll take a look
(12:27:30 AM) omega8cc: ergonlogic: see at the end of every settings.php file "Additional host wide configuration settings. Useful for safely specifying configuration settings."
(12:27:56 AM) omega8cc: oh
(12:28:07 AM) omega8cc: it is before that global.inc
(12:28:11 AM) omega8cc: " # Additional site configuration settings."
(12:28:42 AM) omega8cc: the filename used is local.settings.php
(12:28:58 AM) ergonlogic: right
(12:29:56 AM) omega8cc: ergonlogic: we used it for many imports in the last few days (from messed completely standalone installs with shared tables etc)
(12:30:11 AM) omega8cc: very useful
(12:31:24 AM) ergonlogic: hmm... so aegir must migrate it too, then?
(12:32:20 AM) omega8cc: ergonlogic: yes, but it's nothing new, since Aegir migrates sites/domain as-is and rewrites only settings.php and drushrc
(12:32:35 AM) omega8cc: it works
(12:33:15 AM) ergonlogic: thank you, that'll save me a bunch of mucking around
(12:33:23 AM) omega8cc: so define there all your crazy prefixes and it will work
...
(12:40:45 AM) vertice: as long as you dont mix sites
(12:41:02 AM) vertice: ie: a db with multiple sites in it
(12:41:05 AM) vertice: using prefixes
(12:41:27 AM) vertice: because you'll migrate the other site's db out from under it
(12:41:35 AM) vertice: prefixes are an ugly ugly ugly hack
(12:41:57 AM) vertice: to work around incredibly frustrating limitations in mysql
(12:42:21 AM) omega8cc: vertice: yeah, that is important that those cloned and separate databases will now have many non-used tables with no more used prefixes
(12:42:27 AM) vertice: yeah
(12:42:31 AM) vertice: you put a script up recently
(12:42:39 AM) vertice: to un-prefix db's
(12:42:41 AM) vertice: no ?
(12:42:58 AM) omega8cc: yeah, it is there and it works
(12:43:25 AM) vertice: basically the issue with sharing tables between sites
(12:43:33 AM) vertice: is that they become almost completely unmaintainable
(12:43:46 AM) omega8cc: but it is not enough, I tried it and some sites likes to get broken anyway after unprefixing
(12:43:49 AM) vertice: it becomes a cluster^%$# of unimaginable levels
(12:44:21 AM) vertice: because site a modifies site b's schema out from under it
(12:44:35 AM) vertice: the only way to do it is to completely undo all the prefixing
(12:44:36 AM) vertice: by hand
(12:44:42 AM) vertice: then run update scripts individually
(12:44:46 AM) vertice: then re-do the prefixing
(12:44:50 AM) vertice: but what you prefix changes
(12:44:59 AM) omega8cc: yep, I think it is safe to import such site to Aegir as -is and next carefully migrate to new, prefix free instance/clone
(12:45:07 AM) vertice: and the api functions might not work, due to the relevvant data
(12:45:22 AM) vertice: yeah. but there;s a difference between prefixed tables
(12:45:25 AM) vertice: and shared tables
(12:45:36 AM) omega8cc: yep, it tends to be broken on many levels after unprefixing
(12:45:48 AM) omega8cc: yes
(12:45:51 AM) omega8cc: I know
(12:46:20 AM) vertice: the first is unnecessary, the latter is plain evil
(12:46:57 AM) omega8cc: but I got very nice client who had it both, with some shared tables betwens sites etc
(12:47:37 AM) vertice: yeah. bad things sometimes happen to good people =)
(12:47:50 AM) vertice: the shared tables between sites will %$#& up
(12:47:55 AM) vertice: if not now, then later
(12:48:13 AM) omega8cc: yeah, the good thing with Aegir is it forces people to go back to good practices :)
(12:48:15 AM) vertice: it will never be anything that is even close to maintainable over the long term
(12:48:17 AM) vertice: yeah =)
(12:48:36 AM) vertice: what you *could* do
(12:48:42 AM) vertice: is install a complete non aegir site
(12:48:50 AM) vertice: and install the complete drupal there
(12:48:55 AM) vertice: and use the .notation
(12:49:04 AM) vertice: ie: dbname.tablename
(12:49:06 AM) vertice: in prefixes
(12:49:14 AM) vertice: so the shared tables arent managed by aegir
(12:49:27 AM) vertice: and then use the local.settings.php to add the extra db connection
(12:49:38 AM) vertice: i dont know if you can join across tables on different db's tho
(12:49:54 AM) vertice: it's all so *&^%$# brittle
Comments
#1
This can be added to documentation if it is really useful. Closing