[freeside-users] import 3.6git database into 4.1 ?

Ian Fraser ian_fraser at gozoom.ca
Sat Dec 10 12:48:19 PST 2016


Thanks for the tips....

The rt portion of the upgrade completed     sudo su -l freeside -c 
'/opt/rt3/sbin/rt-setup-database --dba freeside 
--prompt-for-dba-password --action upgrade'   without any errors

And a dry run on the Freeside upgrade

sudo su -l freeside -c '/usr/bin/freeside-upgrade -r -d fs_daily'

appears to complete fine but when I try to actually implement the 
upgrade it dies as below.

guest at freeside4:/opt/rt3$ sudo su -l freeside -c 
'/usr/bin/freeside-upgrade -r fs_daily'
\Subroutine JSON::XS::Boolean::(-- redefined at 
/usr/share/perl/5.20/overload.pm line 50.
Subroutine JSON::XS::Boolean::(++ redefined at 
/usr/share/perl/5.20/overload.pm line 50.
Subroutine JSON::XS::Boolean::(0+ redefined at 
/usr/share/perl/5.20/overload.pm line 50.
FS::part_event::Condition::payby is disabled; skipping
Upgrade startup completed in 3 seconds
UPDATE cust_main SET agent_custid = NULL where agent_custid = ''
UPDATE h_cust_main SET agent_custid = NULL where agent_custid = ''

       SELECT SETVAL( 'upgrade_journal_upgradenum_seq',
                      ( SELECT MAX(upgradenum) FROM upgrade_journal )
                    )

Upgrading cust_bill_pkg_detail schema...
   committing
   done in 0 seconds
Upgrading TicketSystem schema...
   committing
   done in 0 seconds
Upgrading password_history schema...
Can't call method "columns" on an undefined value at 
/usr/share/perl5/FS/password_history.pm line 166.

sub _upgrade_schema {
   # clean up history records where linked_acct has gone away
   my @where;
   for my $fk ( grep /__/, __PACKAGE__->dbdef_table->columns ) 
{                 <--- upgrade dies here
     my ($table, $key) = split(/__/, $fk);
     push @where, "
       ( $fk IS NOT NULL AND NOT EXISTS(SELECT 1 FROM $table WHERE 
$table.$key = $fk) )";
   }
   my @recs = qsearch({
       'table'     => 'password_history',
       'extra_sql' => ' WHERE ' . join(' AND ', @where),
   });
   my $error;
   if (@recs) {
     warn "Removing unattached password_history records 
(".scalar(@recs).").\n";
     foreach my $password_history (@recs) {
       $error = $password_history->delete;
       die $error if $error;
     }
   }
   '';



> On 06/12/2016 1:22 AM, Erreu Gedmon wrote:
>> I haven't tested it, but you could try something like this:
>>
>> su -l freeside -c '/usr/bin/freeside-backup fs_daily' # create a backup, copy it to the 4.1 system
>>
>> /etc/init.d/freeside stop ; pkill -f freeside ; systemctl stop apache2 ; systemsctl restart postgres # stop the 4.1 system
>> createdb -E UTF8 freeside' # create the database if it doesn't exist (I can't recall if this step is necessary)
>> su -l freeside -c 'pg_restore --dbname freeside -Fc freeside_backup.Pg' # restore the database
>> su -l freeside -c "freeside-upgrade fs_daily" # upgrade the 3.6 data to 4.1
>> /etc/init.d/freeside restart
>>
>> Erreu Gedmon
>>
>> --
>> "You see persons and things not as they are but as you are."
>>          -- Anthony De Mello
>>
>> On 12/05/2016 03:22 PM, Ian Fraser wrote:
>>> I have a production 3.6git  instance of Freeside.  'Upgrading' a mirrored development copy has not gone well.
>>>
>>>
>>> Is it possible to import a 3.6 db into a clean 4.1 install or a 4.1 VMWare image ?
>>>
>>>
>>> Thanks,
>>> Ian
>>> _______________________________________________
>>> freeside-users mailing list
>>> freeside-users at freeside.biz
>>> http://freeside.biz/cgi-bin/mailman/listinfo/freeside-users
>> _______________________________________________
>> freeside-users mailing list
>> freeside-users at freeside.biz
>> http://freeside.biz/cgi-bin/mailman/listinfo/freeside-users
>
> -- 
> Ian Fraser
> goZoom.ca Inc.
> 195 Libby's Rd. McNab-Braeside
> K7S0E1
> 877(613) 622 0093 ext 21

-- 
Ian Fraser
goZoom.ca Inc.
195 Libby's Rd. McNab-Braeside
K7S0E1
877(613) 622 0093 ext 21

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://freeside.biz/pipermail/freeside-users/attachments/20161210/6b4f9af3/attachment.html>


More information about the freeside-users mailing list