New koha configuration file. Replaces koha.conf. Needs C4::Context.pm in head to...
[koha.git] / misc / koha.upgrade
1 #!/usr/bin/perl -w
2
3 #use diagnostics;
4 use strict; # please develop with the strict pragma
5 use Install;
6
7 Install::setlanguage('en');
8
9 ###############################################
10 # SET  THE  etcdir  ENVIRONMENT  VAR  INSTEAD #
11 ###############################################
12 Install::setetcdir($ENV{etcdir}||'/etc');
13
14 my $input;
15 loadconfigfile();
16
17 my $curr_ver = Install::getkohaversion();
18 $::newversion=`cat koha.version`;
19 chomp $::newversion;
20 Install::setkohaversion $::newversion;
21
22
23 if ($::newversion =~ /RC/) {
24     releasecandidatewarning();
25 }
26
27 my $answer = showmessage(getmessage('WelcomeToUpgrader',[$curr_ver,$::newversion]),'yn','n');
28 if ($answer eq "Y" || $answer eq "y") {
29         print "Great! continuing upgrade... \n";
30 } else {
31         showmessage(getmessage('AbortingInstall'),'none');
32         exit;
33 };
34
35 Install::setkohaversion($::newversion);
36 checkperlmodules();
37 backupmycnf();
38 backupkoha();
39 getapacheinfo();
40 installfiles();
41 # custom templates warning added to installfiles();
42 updatedatabase();
43 restoremycnf();
44 finalizeconfigfile();
45
46 showmessage(getmessage('UpgradeCompleted',['FIXME','FIXME','FIXME','FIXME','FIXME','FIXME']),'PressEnter');
47
48 # my $reply=showmessage('Would you like to complete a survey about your library? [Y]/N: ', 'yn', 'y');
49 # if ($reply=~/y/i) {
50 #     system("perl kohareporter");
51 # }