BUG Migrating from CentOS

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Migrating from CentOS to Scientific Linux

Here's a simple way to convert your PIAF 2.0.6.5 (only!) server powered by CentOS 6.5 to Scientific Linux 6.5. Make yourself 2 scripts that look like this and run them. Takes about an hour. Also works for me using PIAF 2.0.6.4 server but you may have to do this. Haven't tested anything older than that.

WARNINGS: Proceed at your own risk! Test it on a virtual machine first! DO NOT MIGRATE IF YOUR SERVER IS BEING USED COMMERCIALLY.* THE SL LICENSE SAYS YOU CAN'T USE THEIR REPOS IN THIS CASE. ALSO SCHMOOZE MAY BLOCK YOU FROM USING THEIR COMMERCIAL MODULES. I DON'T KNOW WHAT THEIR POSITION IS ON THIS YET!

Code:
rpm -ivh http://ftp.scientificlinux.org/linux/scientific/6x/i386/os/Packages/yum-conf-sl6x-1-2.noarch.rpm
processor=`uname -i`
centos=${processor:1:3}
if [ $centos != 386 ] ; then
rpm -ivh --force http://ftp.scientificlinux.org/linux/scientific/6x/x86_64/os/Packages/sl-release-6.5-1.x86_64.rpm
else
rpm -ivh --force http://ftp.scientificlinux.org/linux/scientific/6x/i386/os/Packages/sl-release-6.5-1.i686.rpm
fi
sed -i 's|centos-release|sl-release|' /etc/yum.conf
sed -i 's|exclude=centos|\#exclude=centos|' /etc/yum.conf
yum -y erase centos-release
yum -y clean all
yum -y distro-sync
yum -y reinstall `rpm -qa --qf "%{NAME} %{VENDOR}\n"|grep CentOS|awk '{print $1}'`
cd /boot/grub
mv splash.xpm.gz /root/splash.xpm.gz.centos
wget http://pbxinaflash.com/splash.xpm.gz
chmod 644 splash.xpm.gz
chattr -i /etc/pbx/.version
echo "3.0.6.5" > /etc/pbx/.version
chattr +i /etc/pbx/.version
reboot
Code:
cd /usr/src/asterisk
./configure
cd /usr/src/dahdi
make all
make install
service dahdi start
reboot

* Just to be clear. Our position as to GPL2 applicability goes like this. The yum package management system is GPL2 code (see/usr/share/doc/yum-3.2.29) and is an integral part of the collective work whether it's RHEL, CentOS, or Scientific Linux. It's the primary tool for installing, updating, and removing system components. The yum repository and yum.repos.d are integral components of the yum package manager. Under GPL2, there is no "commercial use exception." The only permissible exception is section 8's "geographical distribution limitation." Any component of the collective work that is not an "independent and separate work" cannot be licensed differently than the GPL2collective work as a whole: "You may not impose any further restrictions on the recipients' exercise of the rights granted herein." Since yum is part of the "operating system" and since the yum package management system without a yum repo would be like a day without sunshine, both are subject to the GPL2 license as installed. Stated another way, you can't produce a GPL2 operating system that includes components to keep the operating system current and secure, and then impose a non-commercial usage limitation that would keep the operating system from remaining current and secure when deployed commercially. In our opinion, Scientific Linux may be copied and distributed as a collective work subject to the conditions in sections 2 and 3 of GPL2. This is not legal advice and should not be relied upon to make any momentous or even trivial decision. Consult your own neighborhood attorney for that.
:beatdeadhorse5:
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Migrating from Scientific Linux to PIAF 3.6.5 OS



Here's a simple way to convert your Scientific Linux machine (from above) into a genuine PIAF 3.6.5 OS server. This only takes 10 minutes. Make yourself 2 scripts that look like this and run them.

WARNING: You must first migrate to Scientific Linux before performing the steps below! You are well advised to test this on a virtual machine platform first! No guarantees, warranties, or free lunch...

Code:
rm -f *.repo
processor=`uname -i`
centos=${processor:1:3}
if [ $centos != 386 ] ; then
rpm -ivh --force http://pbxinaflash.com/piaf-release-3.6.5-1.x86_64.rpm
else
rpm -ivh --force http://pbxinaflash.com/piaf-release-3.6.5-1.i686.rpm
fi
sed -i 's|centos-release|piaf3-release|' /etc/yum.conf
sed -i 's|sl-release|piaf3-release|' /etc/yum.conf
sed -i 's|exclude=kernel|\#exclude=kernel|' /etc/yum.repos.d/piaf3.repo
yum -y erase centos-release
yum update kernel*
reboot

Code:
cd /usr/src/asterisk  <-- This should be your most CURRENT asterisk source directory!
./configure
cd /usr/src/dahdi
make all
make install
service dahdi start
yum -y reinstall `rpm -qa --qf "%{NAME} %{VENDOR}\n"|grep CentOS|awk '{print $1}'`
yum -y clean all
yum -y distro-sync
chattr -i /etc/pbx/.version
echo "3.6.5" > /etc/pbx/.version
chattr +i /etc/pbx/.version
echo "sed -i 's|CentOS|PIAF|' /etc/issue" >> /etc/rc.d/rc.local
reboot

Edit: If your DAHDI recompile fails, see the tips in this post for solutions that work!
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
cheeseburger1.jpg
 

rjaiswal

Active Member
Joined
May 24, 2013
Messages
438
Reaction score
58
Wow... Here in NYC, if that was on a menu, the old mayor would have certainly banned it. :)
 

KUMARULLAL

Guru
Joined
Feb 20, 2008
Messages
243
Reaction score
28
Why is the donations link not accepting my America Express card????
The card you entered cannot be used for this payment. Please enter a different credit or debit card number.
 

mbellot

Active Member
Joined
Dec 15, 2008
Messages
404
Reaction score
185
Very cool!

Just so I'm clear here, I need all three scripts, the first (in the OP) to move from CentOS to SL, the next two (in the second post) to move from SL to PIAF-OS. There is no way to move directly from CentOS to PIAF-OS - correct?

Also, can you verify if I'm OK to upgrade? System info below.

Code:
  ┌───────────────────SYSTEM INFORMATION *VERIFIED*─────────────────────┐
  │  Asterisk  = ONLINE   | Dahdi    = ONLINE   | MySQL    = ONLINE     │
  │  SSH        = ONLINE  | Apache    = ONLINE  | Iptables  = ONLINE    │
  │  Fail2ban  = ONLINE   | Internet  = ONLINE  | Ip6Tables = ONLINE    │
  │  Disk Free  = ADEQUATE| Mem Free  = ADEQUATE| NTPD      = ONLINE    │
  │  SendMail  = ONLINE   | Samba    = OFFLINE  | Webmin    = ONLINE    │
  │  Ethernet0  = ONLINE  | Ethernet1 = N/A     | Wlan0    = N/A        │
  │                                                                     │
  │  PIAF Installed Version  = 2.0.6.4 under *HARDWARE*                 │
  │  FreePBX Version          = 2.11.0.23                               │
  │ 2.11                                                                │
  │  Running Asterisk Version = 11.5.1                                  │
  │  Asterisk Source Version  = 11.5.1                                  │
  │  Dahdi Source Version    = 2.7.0.1                                  │
  │  Libpri Source Version    = 1.4.14                                  │
  │  IP Address              = 192.168.XX.YY on eth0                    │
  │  Operating System        = CentOS release 6.4 (Final)               │
  │  Kernel Version          = 2.6.32-358.6.2.el6.i686 - 32 Bit         │
  └─────────────────────────────────────────────────────────────────────┘

I have some extra stuff already set up on PIAF (IncrediFAX but not IncrediblePBX, Lenny, Asterisk Phonebook, etc) that I'm hoping won't be touched as part of the migration - correct?

I need to make a full backup, but if things look good I'm ready to make the move.
 

jeff.h

Guru
Joined
Dec 1, 2010
Messages
502
Reaction score
71
Just ran all 4 sections of code via SSH on a Parallels VM and then on a remote Foxconn box and both upgraded successfully. They were 2.0.6.5 to start with.

I was curious about one thing. Was there a reason for using webmin 1.65? 1.67 has been out for a while now.

This screenshot is from the remote box.

Screen Shot 2014-02-21 at 3.39.10 PM.png
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Re: WebMin. We'll get there, or you can load it yourself if you're in a hurry.
 

jeff.h

Guru
Joined
Dec 1, 2010
Messages
502
Reaction score
71
I can run the update from the webmin page, just wanted to make sure there wasn't a reason not to. Thanks for the instructions above!
 

jeff.h

Guru
Joined
Dec 1, 2010
Messages
502
Reaction score
71
Ran through the process on another Foxconn without incident. This time I started with 2.0.6.4 and 64bit.

Before

Screen Shot 2014-02-21 at 6.44.44 PM.png


After

Screen Shot 2014-02-21 at 7.49.26 PM.png
 

kenn10

Well-Known Member
Joined
Dec 16, 2007
Messages
3,764
Reaction score
2,173
I successfully used the routine and upgraded from Centos 6.3 and PIAF 2.0.6.3.1 to the new version. I had an error about Shorewall that I ultimately had to skip over to proceed. The IPTables functionality and TM3 and Fail2Ban seem OK so I'm not sure I need to worry about it.

Capture2.JPGCapture3.JPG
 

darmock

PIAF Developer
Joined
Oct 18, 2007
Messages
2,892
Reaction score
98
hmmmm have to see what the problems with the iax2/sip/parked calls are have not noticed that before.
 

Members online

No members online now.

Forum statistics

Threads
25,778
Messages
167,504
Members
19,198
Latest member
serhii
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top