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'].

Comments

ttkaminski created an issue. See original summary.

stefan.r’s picture

This will need a patch -- in the mean time I'd recommend commenting out MySQL databases that you don't want to convert.

stefan.r’s picture

In 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."

stefan.r’s picture

Category: Bug report » Feature request
ben.bunk’s picture

Status: Active » Needs review
StatusFileSize
new2.34 KB

Attaching a patch that adds this functionality.

pbull’s picture

The 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.

ben.bunk’s picture

I 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?

zatox’s picture

Version: 7.x-1.0-alpha4 » 7.x-1.0-beta2
Status: Needs review » Reviewed & tested by the community
stefan.r’s picture

Status: Reviewed & tested by the community » Needs work

Can we get an updated README.txt and any suggested changes to make on the project description page based on this patch?

drumm’s picture

Status: Needs work » Needs review
StatusFileSize
new3.2 KB

The attached patch includes an update to README.txt

drumm’s picture

Version: 7.x-1.0-beta2 » 7.x-1.0-rc1
stefan.r’s picture

Status: Needs review » Reviewed & tested by the community

  • stefan.r committed ceacef3 on 7.x-1.x authored by drumm
    Issue #2763135 by pbull, ben.bunk, drumm: Specify databases to convert;...
stefan.r’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.