haste makes waste... and left a method out
[freeside.git] / httemplate / docs / upgrade8.html
1 <head>
2   <title>Upgrading to 1.4.0</title>
3 </head>
4 <body>
5 <h1>Upgrading to 1.4.0 from 1.3.1</h1>
6 <ul>
7   <li>If migrating from less than 1.3.1, see these <a href="upgrade7.html">instructions</a> first.
8   <li>Back up your data and current Freeside installation.
9   <li>Install <a href="http://www.apache-asp.org/">Apache::ASP</a> or <a href="http://www.masonhq.com/">HTML::Mason</a>.
10 </ul>
11 <table>
12   <tr>
13     <th>Apache::ASP</th><th>Mason</th>
14   </tr>
15   <tr>
16     <td><ul>
17       <li>Run <tt>make aspdocs</tt>
18       <li>Copy <tt>aspdocs/</tt> to your web server's document space.
19       <li>Create a <a href="http://www.apache-asp.org/config.html#Global">Global</a> directory, such as <tt>/usr/local/etc/freeside/asp-global/</tt>
20       <li>Copy <tt>htetc/global.asa</tt> to the Global directory.
21       <li>Configure Apache for the Global directory and to execute .cgi files using Apache::ASP.  For example:
22 <font size="-1"><pre>
23 &lt;Directory /usr/local/apache/htdocs/freeside-asp&gt;
24 &lt;Files ~ (\.cgi)&gt;
25 AddHandler perl-script .cgi
26 PerlHandler Apache::ASP
27 &lt;/Files&gt;
28 &lt;Perl&gt;
29 $MLDBM::RemoveTaint = 1;
30 &lt;/Perl&gt;
31 PerlSetVar Global /usr/local/etc/freeside/asp-global/
32 &lt;/Directory&gt;
33 </pre></font>
34     </ul></td>
35     <td><ul>
36       <li>Run <tt>make masondocs</tt>
37       <li>Copy <tt>masondocs/</tt> to your web server's document space.
38       <li>Copy <tt>htetc/handler.pl</tt> to your web server's configuration directory.
39       <li>Edit <tt>handler.pl</tt> and set an appropriate <tt>data_dir</tt>, such as <tt>/usr/local/etc/freeside/mason-data</tt>
40       <li>Configure Apache to use the <tt>handler.pl</tt> file and to execute .cgi files using HTML::Mason.  For example:
41 <font size="-1"><pre>
42 &lt;Directory /usr/local/apache/htdocs/freeside-mason&gt;
43 &lt;Files ~ (\.cgi)&gt;
44 AddHandler perl-script .cgi
45 PerlHandler HTML::Mason
46 &lt;/Files&gt;
47 &lt;Perl&gt;
48 require "/usr/local/apache/conf/handler.pl";
49 &lt;/Perl&gt;
50 &lt;/Directory&gt;
51 </pre></font>
52     </ul></td>
53   </tr>
54 </table>
55 <ul>
56   <li>Change to the FS directory in the new tarball, and build and install the
57       Perl modules:
58     <pre>
59 $ cd FS/
60 $ perl Makefile.PL
61 $ make
62 $ su
63 # make install UNINST=1</pre>
64    <li>Apply the following changes to your database:
65 <pre>
66 CREATE TABLE svc_forward (
67   svcnum int NOT NULL,
68   srcsvc int NOT NULL,
69   dstsvc int NOT NULL,
70   dst varchar(80),
71   PRIMARY KEY (svcnum)
72 );
73
74 CREATE TABLE cust_credit_bill (
75   crednum int not null,
76   invnum int not null,
77   _date timestamp not null,
78   amount decimal(10,2) not null
79 );
80
81 ALTER TABLE svc_acct ADD domsvc integer NOT NULL;
82 ALTER TABLE svc_domain ADD catchall integer NULL;
83 ALTER TABLE part_svc ADD svc_acct__domsvc integer NULL;
84 ALTER TABLE part_svc ADD svc_acct__domsvc_flag char(1) NULL;
85 ALTER TABLE part_svc ADD svc_domain__catchall integer NULL;
86 ALTER TABLE part_svc ADD svc_domain__catchall_flag char(1) NULL;
87 ALTER TABLE part_svc ADD svc_forward__srcsvc integer NULL;
88 ALTER TABLE part_svc ADD svc_forward__srcsvc_flag char(1) NULL;
89 ALTER TABLE part_svc ADD svc_forward__dstsvc integer NULL;
90 ALTER TABLE part_svc ADD svc_forward__dstsvc_flag char(1) NULL;
91 ALTER TABLE part_svc ADD svc_forward__dst integer NULL;
92 ALTER TABLE part_svc ADD svc_forward__dst_flag char(1) NULL;
93 ALTER TABLE cust_main ADD referral_custnum integer NULL;
94 CREATE INDEX cust_main3 ON cust_main ( referral_custnum );
95 CREATE INDEX cust_credit_bill1 ON cust_credit_bill ( crednum );
96 CREATE INDEX cust_credit_bill2 ON cust_credit_bill ( invnum );
97 </pre>
98
99   <li>If you are using PostgreSQL, apply the following changes to your database:
100 <pre>
101 CREATE UNIQUE INDEX agent_pkey ON agent ( agentnum );
102 CREATE UNIQUE INDEX agent_type_pkey agent_type ( typenum );
103 CREATE UNIQUE INDEX cust_bill_pkey ON cust_bill ( invnum );
104 CREATE UNIQUE INDEX cust_credit_pkey ON cust_credit ( crednum );
105 CREATE UNIQUE INDEX cust_main_pkey ON cust_main ( custnum );
106 CREATE UNIQUE INDEX cust_main_county_pkey ON cust_main_county ( taxnum );
107 CREATE UNIQUE INDEX cust_main_invoice_pkey ON cust_main_invoice ( destnum );
108 CREATE UNIQUE INDEX cust_pay_pkey ON cust_pay ( paynum );
109 CREATE UNIQUE INDEX cust_pkg_pkey ON cust_pkg ( pkgnum );
110 CREATE UNIQUE INDEX cust_refund_pkey ON cust_refund ( refundnum );
111 CREATE UNIQUE INDEX cust_svc_pkey ON cust_svc ( svcnum );
112 CREATE UNIQUE INDEX domain_record_pkey ON domain_record ( recnum );
113 CREATE UNIQUE INDEX nas_pkey ON nas ( nasnum );
114 CREATE UNIQUE INDEX part_pkg_pkey ON part_pkg ( pkgpart );
115 CREATE UNIQUE INDEX part_referral_pkey ON part_referral ( refnum );
116 CREATE UNIQUE INDEX part_svc_pkey ON part_svc ( svcpart );
117 CREATE UNIQUE INDEX port_pkey ON port ( portnum );
118 CREATE UNIQUE INDEX prepay_credit_pkey ON prepay_credit ( prepaynum );
119 CREATE UNIQUE INDEX session_pkey ON session ( sessionnum );
120 CREATE UNIQUE INDEX svc_acct_pkey ON svc_acct ( svcnum );
121 CREATE UNIQUE INDEX svc_acct_pop_pkey ON svc_acct_pop ( popnum );
122 CREATE UNIQUE INDEX svc_acct_sm_pkey ON svc_acct_sm ( svcnum );
123 CREATE UNIQUE INDEX svc_domain_pkey ON svc_domain ( svcnum );
124 CREATE UNIQUE INDEX svc_www_pkey ON svc_www ( svcnum );
125 CREATE UNIQUE INDEX type_pkgs_pkey ON type_pkgs ( typenum );
126 </pre>
127   <li>If you wish to enable service/shipping addresses, apply the following
128       changes to your database:
129 <pre>
130 ALTER TABLE cust_main ADD COLUMN ship_last varchar(80) NULL;
131 ALTER TABLE cust_main ADD COLUMN ship_first varchar(80) NULL;
132 ALTER TABLE cust_main ADD COLUMN ship_company varchar(80) NULL;
133 ALTER TABLE cust_main ADD COLUMN ship_address1 varchar(80) NULL;
134 ALTER TABLE cust_main ADD COLUMN ship_address2 varchar(80) NULL;
135 ALTER TABLE cust_main ADD COLUMN ship_city varchar(80) NULL;
136 ALTER TABLE cust_main ADD COLUMN ship_county varchar(80) NULL;
137 ALTER TABLE cust_main ADD COLUMN ship_state varchar(80) NULL;
138 ALTER TABLE cust_main ADD COLUMN ship_zip varchar(10) NULL;
139 ALTER TABLE cust_main ADD COLUMN ship_country char(2) NULL;
140 ALTER TABLE cust_main ADD COLUMN ship_daytime varchar(20) NULL;
141 ALTER TABLE cust_main ADD COLUMN ship_night varchar(20) NULL;
142 ALTER TABLE cust_main ADD COLUMN ship_fax varchar(12) NULL;
143 CREATE INDEX cust_main1 ON cust_main ( ship_last );
144 CREATE INDEX cust_main2 ON cust_main ( ship_company );
145 </pre>
146   <li>If you wish to enable customer comments, apply the following change to
147       your database:
148 <pre>
149 ALTER TABLE cust_main ADD COLUMN comments varchar NULL;
150 </pre>
151   <li>If you are using the signup server, reinstall it according to the <a href="signup.html">instructions</a>.  The 1.3.x signup server is not compatible with 1.4.x.
152   <li>Run bin/dbdef-create.
153   <li>create a service based on svc_forward
154   <li>Run bin/fs-migrate-svc_acct_sm
155   <li>create the conf.dbsrc/user_policy as appropriate for your site
156 </body>