1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
|
<head>
<title>Upgrading to 1.4.0</title>
</head>
<body>
<h1>Upgrading to 1.4.0 from 1.3.1</h1>
<ul>
<li>If migrating from less than 1.3.1, see these <a href="upgrade7.html">instructions</a> first.
<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>)
<li>Install <a href="http://www.apache-asp.org/">Apache::ASP</a> or <a href="http://www.masonhq.com/">HTML::Mason</a>.
</ul>
<table>
<tr>
<th>Apache::ASP</th><th>Mason</th>
</tr>
<tr>
<td><ul>
<li>Run <tt>make aspdocs</tt>
<li>Copy <tt>aspdocs/</tt> to your web server's document space.
<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>
<li>Copy <tt>htetc/global.asa</tt> to the Global directory.
<li>Configure Apache for the Global directory and to execute .cgi files using Apache::ASP. For example:
<font size="-1"><pre>
<Directory /usr/local/apache/htdocs/freeside-asp>
<Files ~ (\.cgi)>
AddHandler perl-script .cgi
PerlHandler Apache::ASP
</Files>
<Perl>
$MLDBM::RemoveTaint = 1;
</Perl>
PerlSetVar Global /usr/local/etc/freeside/asp-global/
</Directory>
</pre></font>
</ul></td>
<td><ul>
<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.
<li>Run <tt>make masondocs</tt>
<li>Copy <tt>masondocs/</tt> to your web server's document space.
<li>Copy <tt>htetc/handler.pl</tt> to your web server's configuration directory.
<li>Edit <tt>handler.pl</tt> and set an appropriate <tt>data_dir</tt>, such as <tt>/usr/local/etc/freeside/mason-data</tt>
<li>Configure Apache to use the <tt>handler.pl</tt> file and to execute .cgi files using HTML::Mason. For example:
<font size="-1"><pre>
<Directory /usr/local/apache/htdocs/freeside-mason>
<Files ~ (\.cgi)>
AddHandler perl-script .cgi
PerlHandler HTML::Mason
</Files>
<Perl>
require "/usr/local/apache/conf/handler.pl";
</Perl>
</Directory>
</pre></font>
</ul></td>
</tr>
</table>
<ul>
<li>Change to the FS directory in the new tarball, and build and install the
Perl modules:
<pre>
$ cd FS/
$ perl Makefile.PL
$ make
$ su
# make install UNINST=1</pre>
<li>Apply the following changes to your database:
<pre>
CREATE TABLE svc_forward (
svcnum int NOT NULL,
srcsvc int NOT NULL,
dstsvc int NOT NULL,
dst varchar(80),
PRIMARY KEY (svcnum)
);
CREATE TABLE cust_credit_bill (
creditbillnum int primary key,
crednum int not null,
invnum int not null,
_date int not null,
amount decimal(10,2) not null
);
CREATE TABLE cust_bill_pay (
billpaynum int primary key,
invnum int not null,
paynum int not null,
_date int not null,
amount decimal(10,2) not null
);
CREATE TABLE cust_credit_refund (
creditrefundnum int primary key,
crednum int not null,
refundnum int not null,
_date int not null,
amount decimal(10,2) not null
);
CREATE TABLE part_svc_column (
columnnum int primary key,
svcpart int not null,
columnname varchar(64) not null,
columnvalue varchar(80) null,
columnflag char(1) null
);
CREATE TABLE queue (
jobnum int primary key,
job varchar not null,
_date int not null,
status varchar(80) not null
);
CREATE TABLE queue_arg (
argnum int primary key,
jobnum int not null,
arg varchar null
);
CREATE INDEX queue_arg1 ON queue_arg ( jobnum );
CREATE TABLE part_pop_local (
localnum int primary key,
popnum int not null,
city varchar(80) null,
state char(2) null,
npa char(3) not null,
nxx char(3) not null
);
CREATE UNIQUE INDEX part_pop_local1 ON part_pop_local ( npa, nxx );
ALTER TABLE svc_acct ADD domsvc integer NOT NULL;
ALTER TABLE svc_domain ADD catchall integer NULL;
ALTER TABLE cust_main ADD referral_custnum integer NULL;
ALTER TABLE cust_pay ADD custnum integer;
ALTER TABLE cust_refund ADD custnum integer;
CREATE INDEX cust_main3 ON cust_main ( referral_custnum );
CREATE INDEX cust_credit_bill1 ON cust_credit_bill ( crednum );
CREATE INDEX cust_credit_bill2 ON cust_credit_bill ( invnum );
CREATE INDEX cust_bill_pay1 ON cust_bill_pay ( invnum );
CREATE INDEX cust_bill_pay2 ON cust_bill_pay ( paynum );
CREATE INDEX cust_credit_refund1 ON cust_credit_refund ( crednum );
CREATE INDEX cust_credit_refund2 ON cust_credit_refund ( refundnum );
CREATE UNIQUE INDEX part_svc_column1 ON part_svc_column ( svcpart, columnname );
</pre>
<li>If you are using PostgreSQL, apply the following changes to your database:
<pre>
CREATE UNIQUE INDEX agent_pkey ON agent ( agentnum );
CREATE UNIQUE INDEX agent_type_pkey agent_type ( typenum );
CREATE UNIQUE INDEX cust_bill_pkey ON cust_bill ( invnum );
CREATE UNIQUE INDEX cust_credit_pkey ON cust_credit ( crednum );
CREATE UNIQUE INDEX cust_main_pkey ON cust_main ( custnum );
CREATE UNIQUE INDEX cust_main_county_pkey ON cust_main_county ( taxnum );
CREATE UNIQUE INDEX cust_main_invoice_pkey ON cust_main_invoice ( destnum );
CREATE UNIQUE INDEX cust_pay_pkey ON cust_pay ( paynum );
CREATE UNIQUE INDEX cust_pkg_pkey ON cust_pkg ( pkgnum );
CREATE UNIQUE INDEX cust_refund_pkey ON cust_refund ( refundnum );
CREATE UNIQUE INDEX cust_svc_pkey ON cust_svc ( svcnum );
CREATE UNIQUE INDEX domain_record_pkey ON domain_record ( recnum );
CREATE UNIQUE INDEX nas_pkey ON nas ( nasnum );
CREATE UNIQUE INDEX part_pkg_pkey ON part_pkg ( pkgpart );
CREATE UNIQUE INDEX part_referral_pkey ON part_referral ( refnum );
CREATE UNIQUE INDEX part_svc_pkey ON part_svc ( svcpart );
CREATE UNIQUE INDEX port_pkey ON port ( portnum );
CREATE UNIQUE INDEX prepay_credit_pkey ON prepay_credit ( prepaynum );
CREATE UNIQUE INDEX session_pkey ON session ( sessionnum );
CREATE UNIQUE INDEX svc_acct_pkey ON svc_acct ( svcnum );
CREATE UNIQUE INDEX svc_acct_pop_pkey ON svc_acct_pop ( popnum );
CREATE UNIQUE INDEX svc_acct_sm_pkey ON svc_acct_sm ( svcnum );
CREATE UNIQUE INDEX svc_domain_pkey ON svc_domain ( svcnum );
CREATE UNIQUE INDEX svc_www_pkey ON svc_www ( svcnum );
CREATE UNIQUE INDEX type_pkgs_pkey ON type_pkgs ( typenum );
</pre>
<li>If you wish to enable service/shipping addresses, apply the following
changes to your database:
<pre>
ALTER TABLE cust_main ADD COLUMN ship_last varchar(80) NULL;
ALTER TABLE cust_main ADD COLUMN ship_first varchar(80) NULL;
ALTER TABLE cust_main ADD COLUMN ship_company varchar(80) NULL;
ALTER TABLE cust_main ADD COLUMN ship_address1 varchar(80) NULL;
ALTER TABLE cust_main ADD COLUMN ship_address2 varchar(80) NULL;
ALTER TABLE cust_main ADD COLUMN ship_city varchar(80) NULL;
ALTER TABLE cust_main ADD COLUMN ship_county varchar(80) NULL;
ALTER TABLE cust_main ADD COLUMN ship_state varchar(80) NULL;
ALTER TABLE cust_main ADD COLUMN ship_zip varchar(10) NULL;
ALTER TABLE cust_main ADD COLUMN ship_country char(2) NULL;
ALTER TABLE cust_main ADD COLUMN ship_daytime varchar(20) NULL;
ALTER TABLE cust_main ADD COLUMN ship_night varchar(20) NULL;
ALTER TABLE cust_main ADD COLUMN ship_fax varchar(12) NULL;
CREATE INDEX cust_main1 ON cust_main ( ship_last );
CREATE INDEX cust_main2 ON cust_main ( ship_company );
</pre>
<li>If you wish to enable customer comments, apply the following change to
your database:
<pre>
ALTER TABLE cust_main ADD COLUMN comments varchar NULL;
</pre>
<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.
<li>Run bin/dbdef-create.
<li>create a service based on svc_forward
<li>Run bin/fs-migrate-svc_acct_sm
<li>Run bin/fs-migrate-payref
<li>Run bin/fs-migrate-part_svc
<li><b>After running bin/fs-migrate-payref</b>, apply the following changes to your database:
<table border><tr><th>PostgreSQL</th><th>MySQL, others</th></tr>
<tr><td>
<font size=-1><pre>
CREATE TABLE cust_pay_temp (
paynum int primary key,
custnum int not null,
paid decimal(10,2) not null,
_date int null,
payby char(4) not null,
payinfo varchar(16) null,
paybatch varchar(80) null
);
INSERT INTO cust_pay_temp SELECT * from cust_pay;
DROP TABLE cust_pay;
ALTER TABLE cust_pay_temp RENAME TO cust_pay;
CREATE UNIQUE INDEX cust_pay1 ON cust_pay paynum;
CREATE TABLE cust_refund_temp (
refundnum int primary key,
custnum int not null,
_date int null,
refund decimal(10,2) not null,
otaker varchar(8) not null,
reason varchar(80) not null,
payby char(4) not null,
payinfo varchar(16) null,
paybatch varchar(80) null
);
INSERT INTO cust_refund_temp SELECT * from cust_refund;
DROP TABLE cust_refund;
ALTER TABLE cust_refund_temp RENAME TO cust_refund;
CREATE UNIQUE INDEX cust_refund1 ON cust_refund refundnum;
</pre></font>
</td><td>
<font size=-1><pre>
ALTER TABLE cust_pay DROP COLUMN invnum;
ALTER TABLE cust_refund DROP COLUMN crednum;
</pre></font>
</td></tr></table>
<li><b>IMPORTANT: After applying the second set of database changes</b>, run bin/dbdef-create again.
<li>create the <a href="config.html#username_policy">user_policy configuration file</a> as appropriate for your site.
<li>Create the `/usr/local/etc/freeside/cache.<i>datasrc</i>' directory
(ownded by the freeside user).
<li>freeside-queued was installed with the Perl modules. Start it now and ensure that is run upon system startup.
</ul>
</body>
|