My have several non-drupal database connections configured in the settings.php $databases array. These additional connections are used in some custom modules and it works great. The default drush command "utf8mb4-convert-databases" will detect and attempt to convert all of these databases, even though I only want/need the drupal one converted. Converting the non-drupal databases can cause unforeseen problems. In addition, if you have a slave database connection setup, you don't want to convert that because it supposed to be replicated from master (although the slave db connection should be read only to begin with).
Possible solutions:
1. Only convert the ['default']['default'] database.
2. Specify which databases to convert
3. Automatically detect if the target database is a drupal install, and convert only those ones.
In the meantime, I'm just going to hack the code to only convert ['default']['default'].
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 2763135.patch | 3.2 KB | drumm |
| #5 | specify-databases-to-convert-2763135-5.patch | 2.34 KB | ben.bunk |
| #6 | interdiff-2763135-5-6.txt | 1.22 KB | pbull |
| #6 | specify-databases-to-convert-2763135-6.patch | 2.68 KB | pbull |
Comments
Comment #2
stefan.r commentedThis will need a patch -- in the mean time I'd recommend commenting out MySQL databases that you don't want to convert.
Comment #3
stefan.r commentedIn the mean time, I have added the following step to the instructions on the project pages:
"Comment out any MySQL databases listed in settings.php that you do not want to convert."
Comment #4
stefan.r commentedComment #5
ben.bunk commentedAttaching a patch that adds this functionality.
Comment #6
pbull commentedThe patch in #5 works great to limit the script to operating on one or more specified databases.
I've re-rolled with a minor tweak to the confirmation text so it informs the user which databases it is going to affect.
Comment #7
ben.bunk commentedI have successfully tested the patch in #6 on 5 different sites in DEV and QA without any issues.
Can I mark this tested by the community or should we wait for another opinion?
Comment #8
zatox commentedComment #9
stefan.r commentedCan we get an updated README.txt and any suggested changes to make on the project description page based on this patch?
Comment #10
drummThe attached patch includes an update to
README.txtComment #11
drummComment #12
stefan.r commentedComment #14
stefan.r commented