2 <title>Upgrading to 1.4.0</title>
5 <h1>Upgrading to 1.4.0 from 1.3.1</h1>
7 <li>If migrating from less than 1.3.1, see these <a href="upgrade7.html">instructions</a> first.
8 <li><font size="+2" color="#ff0000">Backup your database and current Freeside installation.</font> (with <a href="http://www.ca.postgresql.org/devel-corner/docs/postgres/backup.html">PostgreSQL</a>) (with <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Backup">MySQL</a>)
9 <li>Install <a href="http://www.apache-asp.org/">Apache::ASP</a> or <a href="http://www.masonhq.com/">HTML::Mason</a>.
13 <th>Apache::ASP</th><th>Mason</th>
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:
23 <Directory /usr/local/apache/htdocs/freeside-asp>
24 <Files ~ (\.cgi)>
25 AddHandler perl-script .cgi
26 PerlHandler Apache::ASP
29 $MLDBM::RemoveTaint = 1;
31 PerlSetVar Global /usr/local/etc/freeside/asp-global/
36 <li>NOTE: Mason support is still a bit buggy in the 1.4.0 prereleases. This will be fixed before 1.4.0. You have been warned.
37 <li>Run <tt>make masondocs</tt>
38 <li>Copy <tt>masondocs/</tt> to your web server's document space.
39 <li>Copy <tt>htetc/handler.pl</tt> to your web server's configuration directory.
40 <li>Edit <tt>handler.pl</tt> and set an appropriate <tt>data_dir</tt>, such as <tt>/usr/local/etc/freeside/mason-data</tt>
41 <li>Configure Apache to use the <tt>handler.pl</tt> file and to execute .cgi files using HTML::Mason. For example:
43 <Directory /usr/local/apache/htdocs/freeside-mason>
44 <Files ~ (\.cgi)>
45 AddHandler perl-script .cgi
46 PerlHandler HTML::Mason
49 require "/usr/local/apache/conf/handler.pl";
57 <li>Build and install the Perl modules:
60 # make install-perl-modules</pre>
61 <li>Apply the following changes to your database:
63 CREATE TABLE svc_forward (
71 CREATE TABLE cust_credit_bill (
72 creditbillnum int primary key,
76 amount decimal(10,2) not null
79 CREATE TABLE cust_bill_pay (
80 billpaynum int primary key,
84 amount decimal(10,2) not null
87 CREATE TABLE cust_credit_refund (
88 creditrefundnum int primary key,
90 refundnum int not null,
92 amount decimal(10,2) not null
95 CREATE TABLE part_svc_column (
96 columnnum int primary key,
98 columnname varchar(64) not null,
99 columnvalue varchar(80) null,
100 columnflag char(1) null
104 jobnum int primary key,
105 job varchar not null,
107 status varchar(80) not null
110 CREATE TABLE queue_arg (
111 argnum int primary key,
115 CREATE INDEX queue_arg1 ON queue_arg ( jobnum );
117 CREATE TABLE part_pop_local (
118 localnum int primary key,
120 city varchar(80) null,
122 npa char(3) not null,
125 CREATE UNIQUE INDEX part_pop_local1 ON part_pop_local ( npa, nxx );
127 ALTER TABLE svc_acct ADD domsvc integer NOT NULL;
128 ALTER TABLE svc_domain ADD catchall integer NULL;
129 ALTER TABLE cust_main ADD referral_custnum integer NULL;
130 ALTER TABLE cust_pay ADD custnum integer;
131 ALTER TABLE cust_pay_batch ADD paybatchnum integer;
132 ALTER TABLE cust_refund ADD custnum integer;
133 ALTER TABLE cust_pkg ADD manual_flag char(1) NULL;
134 ALTER TABLE part_pkg ADD plan varchar NULL;
135 ALTER TABLE part_pkg ADD plandata varchar NULL;
136 ALTER TABLE part_pkg ADD setuptax char(1) NULL;
137 ALTER TABLE part_pkg ADD recurtax char(1) NULL;
138 CREATE INDEX cust_main3 ON cust_main ( referral_custnum );
139 CREATE INDEX cust_credit_bill1 ON cust_credit_bill ( crednum );
140 CREATE INDEX cust_credit_bill2 ON cust_credit_bill ( invnum );
141 CREATE INDEX cust_bill_pay1 ON cust_bill_pay ( invnum );
142 CREATE INDEX cust_bill_pay2 ON cust_bill_pay ( paynum );
143 CREATE INDEX cust_credit_refund1 ON cust_credit_refund ( crednum );
144 CREATE INDEX cust_credit_refund2 ON cust_credit_refund ( refundnum );
145 CREATE UNIQUE INDEX cust_pay_batch_pkey ON cust_pay_batch ( paybatchnum );
146 CREATE UNIQUE INDEX part_svc_column1 ON part_svc_column ( svcpart, columnname );
149 <li>If you are using PostgreSQL, apply the following changes to your database:
151 CREATE UNIQUE INDEX agent_pkey ON agent ( agentnum );
152 CREATE UNIQUE INDEX agent_type_pkey ON agent_type ( typenum );
153 CREATE UNIQUE INDEX cust_bill_pkey ON cust_bill ( invnum );
154 CREATE UNIQUE INDEX cust_credit_pkey ON cust_credit ( crednum );
155 CREATE UNIQUE INDEX cust_main_pkey ON cust_main ( custnum );
156 CREATE UNIQUE INDEX cust_main_county_pkey ON cust_main_county ( taxnum );
157 CREATE UNIQUE INDEX cust_main_invoice_pkey ON cust_main_invoice ( destnum );
158 CREATE UNIQUE INDEX cust_pay_pkey ON cust_pay ( paynum );
159 CREATE UNIQUE INDEX cust_pkg_pkey ON cust_pkg ( pkgnum );
160 CREATE UNIQUE INDEX cust_refund_pkey ON cust_refund ( refundnum );
161 CREATE UNIQUE INDEX cust_svc_pkey ON cust_svc ( svcnum );
162 CREATE UNIQUE INDEX domain_record_pkey ON domain_record ( recnum );
163 CREATE UNIQUE INDEX nas_pkey ON nas ( nasnum );
164 CREATE UNIQUE INDEX part_pkg_pkey ON part_pkg ( pkgpart );
165 CREATE UNIQUE INDEX part_referral_pkey ON part_referral ( refnum );
166 CREATE UNIQUE INDEX part_svc_pkey ON part_svc ( svcpart );
167 CREATE UNIQUE INDEX port_pkey ON port ( portnum );
168 CREATE UNIQUE INDEX prepay_credit_pkey ON prepay_credit ( prepaynum );
169 CREATE UNIQUE INDEX session_pkey ON session ( sessionnum );
170 CREATE UNIQUE INDEX svc_acct_pkey ON svc_acct ( svcnum );
171 CREATE UNIQUE INDEX svc_acct_pop_pkey ON svc_acct_pop ( popnum );
172 CREATE UNIQUE INDEX svc_acct_sm_pkey ON svc_acct_sm ( svcnum );
173 CREATE UNIQUE INDEX svc_domain_pkey ON svc_domain ( svcnum );
174 CREATE UNIQUE INDEX svc_www_pkey ON svc_www ( svcnum );
175 CREATE UNIQUE INDEX type_pkgs_pkey ON type_pkgs ( typenum );
177 <li>If you wish to enable service/shipping addresses, apply the following
178 changes to your database:
180 ALTER TABLE cust_main ADD COLUMN ship_last varchar(80) NULL;
181 ALTER TABLE cust_main ADD COLUMN ship_first varchar(80) NULL;
182 ALTER TABLE cust_main ADD COLUMN ship_company varchar(80) NULL;
183 ALTER TABLE cust_main ADD COLUMN ship_address1 varchar(80) NULL;
184 ALTER TABLE cust_main ADD COLUMN ship_address2 varchar(80) NULL;
185 ALTER TABLE cust_main ADD COLUMN ship_city varchar(80) NULL;
186 ALTER TABLE cust_main ADD COLUMN ship_county varchar(80) NULL;
187 ALTER TABLE cust_main ADD COLUMN ship_state varchar(80) NULL;
188 ALTER TABLE cust_main ADD COLUMN ship_zip varchar(10) NULL;
189 ALTER TABLE cust_main ADD COLUMN ship_country char(2) NULL;
190 ALTER TABLE cust_main ADD COLUMN ship_daytime varchar(20) NULL;
191 ALTER TABLE cust_main ADD COLUMN ship_night varchar(20) NULL;
192 ALTER TABLE cust_main ADD COLUMN ship_fax varchar(12) NULL;
193 CREATE INDEX cust_main1 ON cust_main ( ship_last );
194 CREATE INDEX cust_main2 ON cust_main ( ship_company );
196 <li>If you wish to enable customer comments, apply the following change to
199 ALTER TABLE cust_main ADD COLUMN comments varchar NULL;
201 <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.
202 <li>Run bin/dbdef-create.
203 <li>If you have svc_acct_sm records or service definitions:
205 <li>Create a service definition with table svc_forward
206 <li>Run bin/fs-migrate-svc_acct_sm
208 <li>Run bin/fs-migrate-payref
209 <li>Run bin/fs-migrate-part_svc
210 <li><b>After running bin/fs-migrate-payref</b>, apply the following changes to your database:
211 <table border><tr><th>PostgreSQL</th><th>MySQL, others</th></tr>
214 CREATE TABLE cust_pay_temp (
215 paynum int primary key,
216 custnum int not null,
217 paid decimal(10,2) not null,
219 payby char(4) not null,
220 payinfo varchar(16) null,
221 paybatch varchar(80) null
223 INSERT INTO cust_pay_temp SELECT * from cust_pay;
225 ALTER TABLE cust_pay_temp RENAME TO cust_pay;
226 CREATE UNIQUE INDEX cust_pay1 ON cust_pay (paynum);
227 CREATE TABLE cust_refund_temp (
228 refundnum int primary key,
229 custnum int not null,
231 refund decimal(10,2) not null,
232 otaker varchar(8) not null,
233 reason varchar(80) not null,
234 payby char(4) not null,
235 payinfo varchar(16) null,
236 paybatch varchar(80) null
238 INSERT INTO cust_refund_temp SELECT * from cust_refund;
239 DROP TABLE cust_refund;
240 ALTER TABLE cust_refund_temp RENAME TO cust_refund;
241 CREATE UNIQUE INDEX cust_refund1 ON cust_refund (refundnum);
245 ALTER TABLE cust_pay DROP COLUMN invnum;
246 ALTER TABLE cust_refund DROP COLUMN crednum;
249 <li><b>IMPORTANT: After applying the second set of database changes</b>, run bin/dbdef-create again.
250 <li>set the <a href="../config/config.cgi#username_policy">user_policy configuration value</a> as appropriate for your site.
251 <li>Create the `/usr/local/etc/freeside/cache.<i>datasrc</i>' directory
252 (ownded by the freeside user).
253 <li>freeside-queued was installed with the Perl modules. Start it now and ensure that is run upon system startup.