first pass at sales reports per agent and package class
[freeside.git] / httemplate / docs / upgrade10.html
1 <head>
2   <title>Upgrading to 1.5.8</title>
3 </head>
4 <body>
5 <h1>Upgrading to 1.5.8 from 1.4.1 or 1.4.2</h1
6
7 <table bgcolor="#dddddd">
8 <tr><td>
9 <i><b>Note:</b> Version numbering has been simplified.  1.5.7 and 1.5.8 are the
10 versions following 1.5.0pre6.  They are still development versions - releases
11 with odd numbered middle parts (NN in x.NN.x) are development versions, like
12 Perl or Linux.
13 </td></tr>
14 </table>
15 <br>
16
17 <ul>
18   <li>If migrating from 1.5.0pre6, see README.1.5.7 instead
19   <li>If migrating from 1.5.7, see README.1.5.8 instead
20   <li> install DBD::Pg 1.32, 1.41 or later (not 1.40) (or, if you're using a Perl version before 5.6, you could try installing DBD::Pg 1.22 with <a href="http://420.am/~ivan/DBD-Pg-1.22-fixvercmp.patch">this patch</a> and commenting out the "use DBD::Pg 1.32" at the top of DBIx/DBSchema/DBD/Pg.pm)
21   <li> install DBIx::DBSchema 0.27 (or later) (if you are running Pg version 7.2.x or earlier, install at least DBIx::DBSchema 0.29)
22   <li> install Net::SSH 0.08 or later
23   <li> install HTML::Widgets::SelectLayers 0.05 or later
24   <li> install Business::CreditCard 0.28 or later
25
26   <li>If using Apache::ASP, add PerlSetVar RequestBinaryRead Off and PerlSetVar IncludesDir /your/freeside/document/root/ to your Apache configuration and make sure you are using Apache::ASP minimum version 2.55.
27     <ul>
28       <li>In httpd.conf, change &lt;Files ~ \.cgi&gt; to  &lt;Files ~ (\.cgi|\.html)&gt;
29       <li>In httpd.conf, change <b>AddHandler perl-script .cgi</b> or <b>SetHandler perl-script</b> to <b>AddHandler perl-script .cgi .html</b>
30     </ul>
31   <li>install NetAddr::IP, Chart::Base, Locale::SubCountry, Text::CSV_XS, 
32 Spreadsheet::WriteExcel, IO-stringy (IO::Scalar), Frontier::RPC
33 (Frontier::RPC2), MIME::Entity (MIME-tools), IPC::Run3, Net::Whois::Raw,
34 JSON, Term::ReadKey and Color::Scheme
35 <!-- and Crypt::YAPassGen-->
36
37   <li>Apply the following changes to your database:
38 <pre>
39 INSERT INTO msgcat ( msgnum, msgcode, locale, msg ) VALUES ( 20, 'svc_external-id', 'en_US', 'External ID' );
40 INSERT INTO msgcat ( msgnum, msgcode, locale, msg ) VALUES ( 21, 'svc_external-title', 'en_US', 'Title' );
41
42 DROP INDEX cust_bill_pkg1;
43 </pre>
44
45   <li>On recent Pg versions:
46 <pre>
47 ALTER TABLE cust_main ALTER COLUMN payinfo varchar(512) NULL;
48 ALTER TABLE h_cust_main ALTER COLUMN payinfo varchar(512) NULL;
49 </pre>
50 On older Pg versions that don't support altering columns directly, you will need to dump the database, edit the schema definitions in the dump file, and reload.
51
52   <li>On recent Pg versions:
53 <pre>
54 ALTER TABLE svc_forward ALTER COLUMN srcsvc DROP NOT NULL;
55 ALTER TABLE h_svc_forward ALTER COLUMN srcsvc DROP NOT NULL;
56 ALTER TABLE svc_forward ALTER COLUMN dstsvc DROP NOT NULL;
57 ALTER TABLE h_svc_forward ALTER COLUMN dstsvc DROP NOT NULL;
58 ALTER TABLE cust_main ALTER COLUMN zip DROP NOT NULL;
59 ALTER TABLE h_cust_main ALTER COLUMN zip DROP NOT NULL;
60 </pre>
61 Or on Pg versions that don't support DROP NOT NULL (tested on 7.1 and 7.2 so far):
62 <pre>
63 UPDATE pg_attribute SET attnotnull = FALSE WHERE ( attname = 'srcsvc' OR attname = 'dstsvc' ) AND ( attrelid = ( SELECT oid FROM pg_class WHERE relname = 'svc_forward' ) OR attrelid = ( SELECT oid FROM pg_class WHERE relname = 'h_svc_forward' ) );
64 UPDATE pg_attribute SET attnotnull = FALSE WHERE ( attname = 'zip' ) AND ( attrelid = ( SELECT oid FROM pg_class WHERE relname = 'cust_main' ) OR attrelid = ( SELECT oid FROM pg_class WHERE relname = 'h_cust_main' ) );
65 </pre>
66
67   <li> If you created your database with a version before 1.4.2, dump database, edit the following, then reload:
68     <ul>
69       <li>cust_main and h_cust_main: increase otaker from 8 to 32
70       <li>cust_main and h_cust_main: change ss from char(11) to varchar(11) ( "character(11)" to "character varying(11)" )
71       <li>cust_credit and h_cust_credit: increase otaker from 8 to 32
72       <li>cust_pkg and h_cust_pkg: increase otaker from 8 to 32
73       <li>cust_refund and h_cust_refund: increase otaker from 8 to 32
74       <li>domain_record and h_domain_record: increase reczone from 80 to 255
75       <li>domain_record and h_domain_record: change rectype from char to varchar ( "character(5)" to "character varying(5)" )
76       <li>domain_record and h_domain_record: increase recdata from 80 to 255
77     </ul>
78
79 <li>make install-perl-modules to install the new libraries and CLI utilities
80 <li>run "freeside-upgrade username" to create the remaining new tables and columns
81
82 <li>optionally:
83 <pre>
84 CREATE INDEX cust_main4 ON cust_main ( daytime );
85 CREATE INDEX cust_main5 ON cust_main ( night );
86 CREATE INDEX cust_main6 ON cust_main ( fax );
87 CREATE INDEX cust_main7 ON cust_main ( refnum );
88 CREATE INDEX cust_main8 ON cust_main ( county );
89 CREATE INDEX cust_main9 ON cust_main ( state );
90 CREATE INDEX cust_main10 ON cust_main ( country );
91 CREATE INDEX cust_main11 ON cust_main ( ship_last );
92 CREATE INDEX cust_main12 ON cust_main ( ship_company );
93 CREATE INDEX cust_main13 ON cust_main ( ship_daytime );
94 CREATE INDEX cust_main14 ON cust_main ( ship_night );
95 CREATE INDEX cust_main15 ON cust_main ( ship_fax );
96 CREATE INDEX agent2 ON agent ( disabled );
97 CREATE INDEX part_bill_event2 ON part_bill_event ( disabled );
98 CREATE INDEX cust_pay4 ON cust_pay (_date);
99 CREATE INDEX part_referral1 ON part_referral ( disabled );
100 CREATE INDEX part_pkg2 ON part_pkg ( promo_code );
101 CREATE INDEX h_part_pkg2 ON h_part_pkg ( promo_code );
102 </pre>
103
104 </ul>
105
106 </body>
107 </html>