&restoremycnf
);
-use vars qw( $kohaversion ); # set in installer.pl
+use vars qw( $kohaversion $newversion ); # set in loadconfigfile and installer.pl
use vars qw( $language ); # set in installer.pl
use vars qw( $domainname ); # set in installer.pl
use vars qw( $mysqlpass ); # normally should not be used
use vars qw( $dbname $hostname $user $pass ); # virtual hosting
-use vars qw( $newversion ); # XXX this seems to be unused
-
=item heading
$messages->{'WelcomeToKohaInstaller'
=cut
sub setkohaversion ($) {
- ($kohaversion) = @_;
+ ($newversion) = @_;
}
=item getservername
|;
+$messages->{'OldFiles'}->{en} = heading('OLD FILES') . qq|
+Any files from the previous edition of Koha have been
+copied to a dated backup directory alongside the new
+installation. You should move any custom files that you
+want to keep (such as your site templates) into the new
+directories and then move the backup off of the live
+server.
+
+Press ENTER to continue:|;
+
$messages->{'CopyingFiles'}->{en}="Copying %s to %s.\n";
intranetdir=$intranetdir
opacdir=$opacdir
kohalogdir=$kohalogdir
-kohaversion=$kohaversion
+kohaversion=$newversion
httpduser=$httpduser
intrahtdocs=$intranetdir/htdocs/intranet-tmpl
opachtdocs=$opacdir/htdocs/opac-tmpl
chown(0, (getpwnam($httpduser)) [3], "$intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh") or warn "can't chown $intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh: $!";
chown(0, (getpwnam($httpduser)) [3], "$intranetdir/scripts/z3950daemon/processz3950queue") or warn "can't chown $intranetdir/scripts/z3950daemon/processz3950queue: $!";
} #MJR: FIXME: Should report that we haven't chown()d.
+
+ showmessage(getmessage('OldFiles'),'PressEnter');
}
exit;
}
- #FIXME: do not ask if we are upgrading from a MARC-ready system
- my $response=showmessage(getmessage('UpdateMarcTables'), 'restrictchar 12N', '1');
+ if ($kohaversion =~ /^1\.[012]\./) {
+ my $response=showmessage(getmessage('UpdateMarcTables'), 'restrictchar 12N', '1');
- startsysout();
- if ($response eq '1') {
- system("cat scripts/misc/marc_datas/marc21_en/structure_def.sql | $mysqldir/bin/mysql -u$user $dbname");
- }
- if ($response eq '2') {
- system("cat scripts/misc/marc_datas/unimarc_fr/structure_def.sql | $mysqldir/bin/mysql -u$user $dbname");
- system("cat scripts/misc/lang-datas/fr/stopwords.sql | $mysqldir/bin/mysql -u$user $dbname");
+ startsysout();
+ if ($response eq '1') {
+ system("cat scripts/misc/marc_datas/marc21_en/structure_def.sql | $mysqldir/bin/mysql -u$user $dbname");
+ }
+ if ($response eq '2') {
+ system("cat scripts/misc/marc_datas/unimarc_fr/structure_def.sql | $mysqldir/bin/mysql -u$user $dbname");
+ system("cat scripts/misc/lang-datas/fr/stopwords.sql | $mysqldir/bin/mysql -u$user $dbname");
+ }
+ delete($ENV{"KOHA_CONF"});
}
- delete($ENV{"KOHA_CONF"});
print RESET."\n\nFinished updating of database. Press <ENTER> to continue...";
<STDIN>;
print "Great! continuing upgrade... \n";
};
+setkohaversion($::newversion);
checkperlmodules();
backupkoha();
getapacheinfo();
installfiles();
-
-#FIXME: Copy custom templates and reports back in, or warn
-
-#opendir D, "$backupdir/kohafiles-$date/intranet/htdocs/";
-#my @dirlist=readdir D;
-#foreach (@dirlist) {
-# (next) if (/^\./);
-# (next) if ($_ eq 'default');
-# (next) if ($_ eq 'doc');
-# (next) if ($_=~/^koha-/);
-# (next) if (-e "$::intranetdir/htdocs/$_");
-# print "Restoring custom intranet templates $_...\n";
-# system("cp -a $backupdir/kohafiles-$date/intranet/htdocs/$_ $::intranetdir/htdocs/");
-#}
-#
-#opendir D, "$backupdir/kohafiles-$date/opac/htdocs/";
-#@dirlist=readdir D;
-#foreach (@dirlist) {
-# (next) if (/^\./);
-# (next) if ($_ eq 'default');
-# (next) if ($_ eq 'doc');
-# (next) if ($_=~/^koha-/);
-# (next) if (-e "$::opacdir/htdocs/$_");
-# print "Restoring custom opac template $_...\n";
-# system("cp -a $backupdir/kohafiles-$date/opac/htdocs/$_ $::opacdir/htdocs/");
-#}
+# custom templates warning added to installfiles();
updatedatabase();
finalizeconfigfile();