Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
update system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
26 Oct 2008 at 20:04 UTC
Updated:
26 Oct 2008 at 20:33 UTC
When users will be migrating from Drupal 6.x to 7.x, there is no more $db_url variable, and we have the $databases array.
In most cases, users will not have $db_url as an array, in case they are using additional databases, or have master/slave databases. So, in this case, it should be straight forward to migrate their database settings. If they do have one of the advanced settings, then we should just give a message, and they are advanced enough to do it manually.
Here is a initial code for this ...
if (isset($db_url)) {
$data = parse_url($db_url);
$databases = array (
'default' =>
array (
'default' =>
array (
'driver' => $data['scheme'],
'database' => str_replace('/', '', $data['path']),
'username' => $data['user'],
'password' => $data['pass'],
'host' => $data['host'],
'port' => $data['port'],
),
),
);
print_r($databases);
}
else {
// Give a message that they have to migrate manually
}
Comments
Comment #1
David_Rothstein commentedJust a note: This grew out of #303889: Impossible to update D6 -> D7, where there is now a patch that contains some proposed code similar to the above... (but it might get moved over here depending on how things go).
Comment #2
chx commentedhttp://drupal.org/node/304163