Closed (won't fix)
Project:
Provision
Version:
6.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Jun 2009 at 21:11 UTC
Updated:
23 Aug 2012 at 11:19 UTC
Jump to comment: Most recent file
Comments
Comment #1
anarcat commentedWe think this doesn't desserve our attention until the next release.
Comment #2
anarcat commentedchanging target release
Comment #3
anarcat commentedWe should also make sure this works in migrations... #556598: $db_prefix not handled in migration
Comment #4
tiato commentedI wonder if this is related somehow http://drupal.org/node/195416
If so, seems to be more of a Drupal issue in the way it handles prefixes (sp?)
Comment #5
anarcat commented@tiato - no, I don't think this is the problem here.
Comment #6
adrian commentedi think we should provide a script that renames tables, but not support this in aegir proper.
Comment #7
omega8cc commentedIn any case, before going with renaming tables (which should be always recommended) you can import (and run) a site using prefixes by adding site specific code to global.inc - example:
Comment #8
adrian commentedwhat would a script to rename the tables look like?
Comment #9
omega8cc commentedQuick example of script for adding or removing a prefix on existing tables in mysql: http://drupal.org/node/403742
Comment #10
omega8cc commentedTo keep it short:
Comment #11
adrian commentedthe reason i distrust the prefix tables, is that the prefixing is often used to do many many kludgy things, such as sharing tables between sites (which we will never support) and having multiple sites in a single database (which we will never support).
So we can provide a mechanism to do this functionality manually, but we must document the hell of out of the fact that if you've done the above you need to do more than just unprefix your tables.
Comment #12
cashwilliams commentedJust an FYI, a site using table prefixes will also break every time a backup is run (as of beta2 which I tested). I've got nightly backups running via a drush script and every morning the site is down.
This is an old site imported from a shared host, so now I can rename the tables, but I think this issue is a little more serious then just breaking an import.
Comment #13
cashwilliams commentedAttached is a more elaborate version of #10 which doesn't delete existing tables without the prefix, but also drops the table if it exists before trying to rename it. My database was pretty dirty and had a fresh install amongst the prefixed tables.
Two variables should be configured at the top, one for the prefix of the current tables and one to just simulate the changes.
I've tested it and ran it against my site using:
Remove the $db_prefix from settings.php, then clear caches with
Comment #14
anarcat commentedThat script looks like a good start!
Could you make that into a complete drush command? I am sure others would find it useful, and then it could be included in drush or aegir...
Comment #15
steven jones commentedI feel like this could be it's own standalone Drush command and not really Aegir specific, and in the interests of making Aegir maintainable, I'm going to mark this as won't fix, but if someone wants to write the drush command we'd happily link to it from our migrating sites into Aegir documentation.