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><a href="http://perl.apache.org/">mod_perl</a> is now required.
10 <li>Install <a href="http://search.cpan.org/search?dist=Time-Duration">Time-Duration</a>, <a href="http://search.cpan.org/search?dist=Tie-IxHash">Tie-IxHash</a> and <a href="http://search.cpan.org/search?dist=HTML-Widgets-SelectLayers">HTML-Widgets-SelectLayers</a>.
11 <li>Install <a href="http://www.apache-asp.org/">Apache::ASP</a> or <a href="http://www.masonhq.com/">HTML::Mason</a>.
12 <li>Install <a href="http://rsync.samba.org/">rsync</a>
16 <th>Apache::ASP</th><th>Mason</th>
20 <li>Run <tt>make aspdocs</tt>
21 <li>Copy <tt>aspdocs/</tt> to your web server's document space.
22 <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>
23 <li>Copy <tt>htetc/global.asa</tt> to the Global directory.
24 <li>Configure Apache for the Global directory and to execute .cgi files using Apache::ASP. For example:
26 <Directory /usr/local/apache/htdocs/freeside-asp>
27 <Files ~ (\.cgi)>
28 AddHandler perl-script .cgi
29 PerlHandler Apache::ASP
32 $MLDBM::RemoveTaint = 1;
34 PerlSetVar Global /usr/local/etc/freeside/asp-global/
39 <li>Run <tt>make masondocs</tt>
40 <li>Copy <tt>masondocs/</tt> to your web server's document space.
41 <li>Copy <tt>htetc/handler.pl</tt> to your web server's configuration directory.
42 <li>Edit <tt>handler.pl</tt> and set an appropriate <tt>data_dir</tt>, such as <tt>/usr/local/etc/freeside/mason-data</tt>
43 <li>Configure Apache to use the <tt>handler.pl</tt> file and to execute .cgi files using HTML::Mason. For example:
45 <Directory /usr/local/apache/htdocs/freeside-mason>
46 <Files ~ (\.cgi)>
47 AddHandler perl-script .cgi
48 PerlHandler HTML::Mason
51 require "/usr/local/apache/conf/handler.pl";
59 <li>Build and install the Perl modules:
62 # make install-perl-modules</pre>
63 <li>Apply the following changes to your database:
65 CREATE TABLE svc_forward (
73 CREATE TABLE cust_credit_bill (
74 creditbillnum int primary key,
78 amount decimal(10,2) not null
81 CREATE TABLE cust_bill_pay (
82 billpaynum int primary key,
86 amount decimal(10,2) not null
89 CREATE TABLE cust_credit_refund (
90 creditrefundnum int primary key,
92 refundnum int not null,
94 amount decimal(10,2) not null
97 CREATE TABLE part_svc_column (
98 columnnum int primary key,
100 columnname varchar(64) not null,
101 columnvalue varchar(80) null,
102 columnflag char(1) null
106 jobnum int primary key,
109 status varchar(80) not null,
110 statustext text null,
113 CREATE INDEX queue1 ON queue ( svcnum );
114 CREATE INDEX queue2 ON queue ( status );
116 CREATE TABLE queue_arg (
117 argnum int primary key,
121 CREATE INDEX queue_arg1 ON queue_arg ( jobnum );
123 CREATE TABLE part_pop_local (
124 localnum int primary key,
126 city varchar(80) null,
128 npa char(3) not null,
131 CREATE UNIQUE INDEX part_pop_local1 ON part_pop_local ( npa, nxx );
133 CREATE TABLE cust_bill_event (
134 eventnum int primary key,
136 eventpart int not null,
139 CREATE UNIQUE INDEX cust_bill_event1 ON cust_bill_event ( eventpart, invnum );
140 CREATE INDEX cust_bill_event2 ON cust_bill_event ( invnum );
142 CREATE TABLE part_bill_event (
143 eventpart int primary key,
144 payby char(4) not null,
145 event varchar(80) not null,
149 plan varchar(80) null,
151 disabled char(1) null
153 CREATE INDEX part_bill_event1 ON part_bill_event ( payby );
155 CREATE TABLE part_export (
156 exportnum int primary key,
157 svcpart int not null,
158 machine varchar(80) not null,
159 exporttype varchar(80) not null,
160 nodomain char(1) NULL
162 CREATE INDEX part_export1 ON part_export ( machine );
163 CREATE INDEX part_export2 ON part_export ( exporttype );
165 CREATE TABLE part_export_option (
166 optionnum int primary key,
167 exportnum int not null,
168 optionname varchar(80) not null,
169 optionvalue text NULL
171 CREATE INDEX part_export_option1 ON part_export_option ( exportnum );
172 CREATE INDEX part_export_option2 ON part_export_option ( optionname );
174 CREATE TABLE radius_usergroup (
175 usergroupnum int primary key,
177 groupname varchar(80) not null
179 CREATE INDEX radius_usergroup1 ON radius_usergroup ( svcnum );
180 CREATE INDEX radius_usergroup2 ON radius_usergroup ( groupname );
182 ALTER TABLE svc_acct ADD domsvc integer NOT NULL;
183 ALTER TABLE svc_domain ADD catchall integer NULL;
184 ALTER TABLE cust_main ADD referral_custnum integer NULL;
185 ALTER TABLE cust_pay ADD custnum integer;
186 ALTER TABLE cust_pay_batch ADD paybatchnum integer;
187 ALTER TABLE cust_refund ADD custnum integer;
188 ALTER TABLE cust_pkg ADD manual_flag char(1) NULL;
189 ALTER TABLE part_pkg ADD plan varchar(80) NULL;
190 ALTER TABLE part_pkg ADD plandata text NULL;
191 ALTER TABLE part_pkg ADD setuptax char(1) NULL;
192 ALTER TABLE part_pkg ADD recurtax char(1) NULL;
193 ALTER TABLE part_pkg ADD disabled char(1) NULL;
194 ALTER TABLE part_svc ADD disabled char(1) NULL;
195 ALTER TABLE cust_bill ADD closed char(1) NULL;
196 ALTER TABLE cust_pay ADD closed char(1) NULL;
197 ALTER TABLE cust_credit ADD closed char(1) NULL;
198 ALTER TABLE cust_refund ADD closed char(1) NULL;
199 ALTER TABLE cust_bill_event ADD status varchar(80);
200 ALTER TABLE cust_bill_event ADD statustext text NULL;
201 CREATE INDEX cust_main3 ON cust_main ( referral_custnum );
202 CREATE INDEX cust_credit_bill1 ON cust_credit_bill ( crednum );
203 CREATE INDEX cust_credit_bill2 ON cust_credit_bill ( invnum );
204 CREATE INDEX cust_bill_pay1 ON cust_bill_pay ( invnum );
205 CREATE INDEX cust_bill_pay2 ON cust_bill_pay ( paynum );
206 CREATE INDEX cust_credit_refund1 ON cust_credit_refund ( crednum );
207 CREATE INDEX cust_credit_refund2 ON cust_credit_refund ( refundnum );
208 CREATE UNIQUE INDEX cust_pay_batch_pkey ON cust_pay_batch ( paybatchnum );
209 CREATE UNIQUE INDEX part_svc_column1 ON part_svc_column ( svcpart, columnname );
210 CREATE INDEX cust_pay2 ON cust_pay ( paynum );
211 CREATE INDEX cust_pay3 ON cust_pay ( custnum );
212 CREATE INDEX cust_pay4 ON cust_pay ( paybatch );
215 <li>If you are using PostgreSQL, apply the following changes to your database:
217 CREATE UNIQUE INDEX agent_pkey ON agent ( agentnum );
218 CREATE UNIQUE INDEX agent_type_pkey ON agent_type ( typenum );
219 CREATE UNIQUE INDEX cust_bill_pkey ON cust_bill ( invnum );
220 CREATE UNIQUE INDEX cust_credit_pkey ON cust_credit ( crednum );
221 CREATE UNIQUE INDEX cust_main_pkey ON cust_main ( custnum );
222 CREATE UNIQUE INDEX cust_main_county_pkey ON cust_main_county ( taxnum );
223 CREATE UNIQUE INDEX cust_main_invoice_pkey ON cust_main_invoice ( destnum );
224 CREATE UNIQUE INDEX cust_pay_pkey ON cust_pay ( paynum );
225 CREATE UNIQUE INDEX cust_pkg_pkey ON cust_pkg ( pkgnum );
226 CREATE UNIQUE INDEX cust_refund_pkey ON cust_refund ( refundnum );
227 CREATE UNIQUE INDEX cust_svc_pkey ON cust_svc ( svcnum );
228 CREATE UNIQUE INDEX domain_record_pkey ON domain_record ( recnum );
229 CREATE UNIQUE INDEX nas_pkey ON nas ( nasnum );
230 CREATE UNIQUE INDEX part_pkg_pkey ON part_pkg ( pkgpart );
231 CREATE UNIQUE INDEX part_referral_pkey ON part_referral ( refnum );
232 CREATE UNIQUE INDEX part_svc_pkey ON part_svc ( svcpart );
233 CREATE UNIQUE INDEX port_pkey ON port ( portnum );
234 CREATE UNIQUE INDEX prepay_credit_pkey ON prepay_credit ( prepaynum );
235 CREATE UNIQUE INDEX session_pkey ON session ( sessionnum );
236 CREATE UNIQUE INDEX svc_acct_pkey ON svc_acct ( svcnum );
237 CREATE UNIQUE INDEX svc_acct_pop_pkey ON svc_acct_pop ( popnum );
238 CREATE UNIQUE INDEX svc_acct_sm_pkey ON svc_acct_sm ( svcnum );
239 CREATE UNIQUE INDEX svc_domain_pkey ON svc_domain ( svcnum );
240 CREATE UNIQUE INDEX svc_www_pkey ON svc_www ( svcnum );
241 CREATE UNIQUE INDEX type_pkgs_pkey ON type_pkgs ( typenum );
243 <li>If you wish to enable service/shipping addresses, apply the following
244 changes to your database:
246 ALTER TABLE cust_main ADD COLUMN ship_last varchar(80) NULL;
247 ALTER TABLE cust_main ADD COLUMN ship_first varchar(80) NULL;
248 ALTER TABLE cust_main ADD COLUMN ship_company varchar(80) NULL;
249 ALTER TABLE cust_main ADD COLUMN ship_address1 varchar(80) NULL;
250 ALTER TABLE cust_main ADD COLUMN ship_address2 varchar(80) NULL;
251 ALTER TABLE cust_main ADD COLUMN ship_city varchar(80) NULL;
252 ALTER TABLE cust_main ADD COLUMN ship_county varchar(80) NULL;
253 ALTER TABLE cust_main ADD COLUMN ship_state varchar(80) NULL;
254 ALTER TABLE cust_main ADD COLUMN ship_zip varchar(10) NULL;
255 ALTER TABLE cust_main ADD COLUMN ship_country char(2) NULL;
256 ALTER TABLE cust_main ADD COLUMN ship_daytime varchar(20) NULL;
257 ALTER TABLE cust_main ADD COLUMN ship_night varchar(20) NULL;
258 ALTER TABLE cust_main ADD COLUMN ship_fax varchar(12) NULL;
259 CREATE INDEX cust_main1 ON cust_main ( ship_last );
260 CREATE INDEX cust_main2 ON cust_main ( ship_company );
262 <li>If you wish to enable customer comments, apply the following change to
265 ALTER TABLE cust_main ADD COLUMN comments text NULL;
267 <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.
268 <li>Run bin/dbdef-create.
269 <li>If you have svc_acct_sm records or service definitions:
271 <li>Create a service definition with table svc_forward
272 <li>Run bin/fs-migrate-svc_acct_sm
274 <li>Run bin/fs-migrate-payref
275 <li>Run bin/fs-migrate-part_svc
276 <li><b>After running bin/fs-migrate-payref</b>, apply the following changes to your database:
277 <table border><tr><th>PostgreSQL</th><th>MySQL, others</th></tr>
280 CREATE TABLE cust_pay_temp (
281 paynum int primary key,
282 custnum int not null,
283 paid decimal(10,2) not null,
285 payby char(4) not null,
286 payinfo varchar(16) null,
287 paybatch varchar(80) null
289 INSERT INTO cust_pay_temp SELECT * from cust_pay;
291 ALTER TABLE cust_pay_temp RENAME TO cust_pay;
292 CREATE UNIQUE INDEX cust_pay1 ON cust_pay (paynum);
293 CREATE TABLE cust_refund_temp (
294 refundnum int primary key,
295 custnum int not null,
297 refund decimal(10,2) not null,
298 otaker varchar(8) not null,
299 reason varchar(80) not null,
300 payby char(4) not null,
301 payinfo varchar(16) null,
302 paybatch varchar(80) null
304 INSERT INTO cust_refund_temp SELECT * from cust_refund;
305 DROP TABLE cust_refund;
306 ALTER TABLE cust_refund_temp RENAME TO cust_refund;
307 CREATE UNIQUE INDEX cust_refund1 ON cust_refund (refundnum);
311 ALTER TABLE cust_pay DROP COLUMN invnum;
312 ALTER TABLE cust_refund DROP COLUMN crednum;
315 <li><b>IMPORTANT: After applying the second set of database changes</b>, run bin/dbdef-create again.
316 <li><b>IMPORTANT</b>: run bin/create-history-tables
317 <li><b>IMPORTANT: After running bin/create-history-tables</b>, run bin/dbdef-create again.
318 <li>set the <a href="../config/config.cgi#username_policy">user_policy configuration value</a> as appropriate for your site.
319 <li>the mxmachines, nsmachines, arecords and cnamerecords configuration values have been deprecated. Set the <a href="../config/config.cgi#defaultrecords">defaultrecords configuration value</a> instead.
320 <li>Create the `/usr/local/etc/freeside/cache.<i>datasrc</i>' directory
321 (owned by the freeside user).
322 <li>freeside-queued was installed with the Perl modules. Start it now and ensure that is run upon system startup.
323 <li>Set appropriate <a href="../browse/part_bill_event.cgi">invoice events</a> for your site. At the very least, you'll want to set some invoice events "<i>After 0 days</i>": a <i>BILL</i> invoice event to print invoices, a <i>CARD</i> invoice event to batch or run cards real-time, and a <i>COMP</i> invoice event to "pay" complimentary customers. If you were using the <i>-i</i> option to <a href="man/bin/freeside-bill.html">freeside-bill</a> it should be removed.
324 <li>Use <a href="man/bin/freeside-daily.html">freeside-daily</a> instead of <a href="man/bin/freeside-bill.html">freeside-bill</a>.
325 <li>If you would like Freeside to notify your customers when their credit
326 cards and other billing arrangements are about to expire, arrange for
327 <b>freeside-expiration-alerter</b> to be run daily by cron or similar
328 facility. The message it sends can be configured from the
329 <u>Configuration</u> choice of the main menu as <u>alerter_template</u>.
330 <li>Export has been rewritten. If you were using the icradiusmachines,
331 icradius_mysqldest, icradius_mysqlsource, or icradius_secrets files, add
332 an appropriate "sqlradius" export to all relevant Service Definitions
333 instead. Use <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Replication">MySQL replication</a> or
334 point the "sqlradius" export directly at your external ICRADIUS or FreeRADIUS
335 database (or through an SSL-necrypting proxy...)