From 53ab84ccffa621c690e99e01b557932e66b3a5da Mon Sep 17 00:00:00 2001 From: JT Smith Date: Wed, 7 Dec 2005 00:16:02 +0000 Subject: [PATCH] better upgrade --- docs/changelog/6.x.x.txt | 2 ++ sbin/upgrade.pl | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 3996f6d56..dd2d71be2 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -23,6 +23,8 @@ sbin/rebuildLineage.pl - fix [ 1356544 ] FAQ template in collaboration has wrong anchors - fix [ 1373493 ] Upgrade script fails because parameters are not quoted + - Upgrade now uses --results-file parameter on mysqldump because some + operating system don't handle UTF-8 characters through their pipes. 6.8.0 - Switched Date::Manip to DateTime for better performance and more diff --git a/sbin/upgrade.pl b/sbin/upgrade.pl index 0e463661d..c10da22de 100644 --- a/sbin/upgrade.pl +++ b/sbin/upgrade.pl @@ -28,8 +28,8 @@ my $help; my $history; my $override; my $quiet; -my $mysql = "/usr/bin/mysql"; -my $mysqldump = "/usr/bin/mysqldump"; +my $mysql = "mysql"; +my $mysqldump = "mysqldump"; my $backupDir = "/tmp/backups"; my $skipBackup; my $doit; @@ -56,7 +56,7 @@ Usage: perl $0 --doit Options: --backupDir The folder where backups should be - created. Defaults to '/data/backups'. + created. Defaults to '$backupDir'. --doit This flag is required. You MUST include this flag in your command line or the upgrade @@ -69,10 +69,10 @@ Options: flag will NOT run the upgrade. --mysql The path to your mysql client executable. - Defaults to '/usr/bin/mysql'. + Defaults to '$mysqldump'. --mysqldump The path to your mysqldump executable. - Defaults to '/usr/bin/mysqldump'. + Defaults to '$mysql'. --override This utility is designed to be run as a privileged user on Linux style systems. @@ -236,7 +236,7 @@ foreach my $filename (keys %config) { my $cmd = qq!$dumpcmd -u"$config{$filename}{dbuser}" -p"$config{$filename}{dbpass}"!; $cmd .= " --host=".$config{$filename}{host} if ($config{$filename}{host}); $cmd .= " --port=".$config{$filename}{port} if ($config{$filename}{port}); - $cmd .= " --add-drop-table --databases ".$config{$filename}{db}." > " + $cmd .= " --add-drop-table --databases ".$config{$filename}{db}." --result-file=" .$backupTo.$slash.$config{$filename}{db}."_".$upgrade{$upgrade}{from}.".sql"; unless (system($cmd)) { print "OK\n" unless ($quiet);