@lab Wiki: Difference between revisions
Jpr@uab.edu (talk | contribs) (→Upgrading Drupal: Add note about configuration of instances) |
Jpr@uab.edu (talk | contribs) (→Configuring instances for upgrade: Added site mod code snippet; Fixed header markup) |
||
Line 19: | Line 19: | ||
Some additional important notes for upgrading can be found on the drupal site http://drupal.org/upgrade/ | Some additional important notes for upgrading can be found on the drupal site http://drupal.org/upgrade/ | ||
== Configuring instances for upgrade | == Configuring instances for upgrade == | ||
The 4.4 and 4.5 release still use the includes/conf.php file. After that it switches to the site/default/settings.php approach. They all use the $db_url and $base_url configuration values, though so it should be easy to just plug in the original site values. The $base_url is optional in 4.7.6. | The 4.4 and 4.5 release still use the includes/conf.php file. After that it switches to the site/default/settings.php approach. They all use the $db_url and $base_url configuration values, though so it should be easy to just plug in the original site values. The $base_url is optional in 4.7.6. | ||
Perl script to change config across many versions for upgrading: | |||
#!/usr/bin/perl -w | |||
$sitedb = $ARGV[0]; | |||
$siteurl = $ARGV[1]; | |||
while (<STDIN>) { | |||
s/([\"\']).*([\'\"])/$1$sitedb$2/ if ( /^\$db_url =/ ); | |||
s/([\"\']).*([\'\"])/$1$siteurl$2/ if ( /^\$base_url =/ ); | |||
print; | |||
} | |||
Name the above script "setsite.pl" and run it as follows: | |||
# cd to top-level of multi-drupal site dir | |||
for file in `grep -rl '^\$db_url =' *` | |||
do | |||
./setsite.pl mysql://dbuser:dbpass@localhost/dbname \ | |||
<nowiki>http://host/path</nowiki> < $file > $file.new | |||
mv $file.new $file | |||
done |
Revision as of 22:04, 19 July 2007
Supporting Local VO Rosources
The @lab contributes many of it's own resources to the VO. These pages will help document the configuration and management of those resources.
Upgrading Drupal
The @lab drupal site has aged significantly. It's not been updated since 4.3.x. In order to upgrade to the latest release in the 4.x line (4.7.6 as of this writing) all intermediate version update.php scripts need to be applied to the database. This is pretty easy to do. It just requires that you install the intermediate releases, configure them to point at the database, and step through the update.php scripts.
Links to older versions of drupal are not too hard to find, at least back to 4.5. The basic URL structure for the release page is http://drupal.org/drupal-x.x.x and the download file is http://drupal.org/files/projects/drupal-x.x.x.tar.gz. Before the 4.5.0 release, the release pages don't have well-known page names, seems Google is the best option here, just look for drupal-x.x.x, where the x's are the vesion number. The file structure changes, but it's still guessable, just replace "tar.gz" with "tgz".
For our upgrade path, the relevant release pages and download links are:
- Drupal 4.7.6 - http://drupal.org/files/projects/drupal-4.7.6.tar.gz
- Drupal 4.6.0 - http://drupal.org/files/projects/drupal-4.6.0.tar.gz
- Drupal 4.5.0 - http://drupal.org/files/projects/drupal-4.5.0.tar.gz
- Drupal 4.4.0 - http://drupal.org/drupal/drupal-4.4.0.tgz (note the release note and download link structure changes)
Some additional important notes for upgrading can be found on the drupal site http://drupal.org/upgrade/
Configuring instances for upgrade
The 4.4 and 4.5 release still use the includes/conf.php file. After that it switches to the site/default/settings.php approach. They all use the $db_url and $base_url configuration values, though so it should be easy to just plug in the original site values. The $base_url is optional in 4.7.6.
Perl script to change config across many versions for upgrading:
#!/usr/bin/perl -w $sitedb = $ARGV[0]; $siteurl = $ARGV[1]; while (<STDIN>) { s/([\"\']).*([\'\"])/$1$sitedb$2/ if ( /^\$db_url =/ ); s/([\"\']).*([\'\"])/$1$siteurl$2/ if ( /^\$base_url =/ ); print; }
Name the above script "setsite.pl" and run it as follows:
# cd to top-level of multi-drupal site dir for file in `grep -rl '^\$db_url =' *` do ./setsite.pl mysql://dbuser:dbpass@localhost/dbname \ http://host/path < $file > $file.new mv $file.new $file done