Moving asterisk to a new server

Hi,

I need to move the company asterisk server to new hardware, but i didn’t installed it myself, so first thing, how to know asterisk version installed?
Then, if i only backup content of /etc/asterisk, is that enough?

Last think, on the new server, i still don’t know if i will reinstall asterisk above a Linux server install, or directly Asterisknow or Trixbox? any advice on this? For info, we only use asterisk for outgoing call (with Voipbuster) up to now, so we realy use only very basic settings. But there are plan to improve that…

Thanks in advance,

Nicolas

Hi

For your first question it’s very simple.
the asterisk -V command returns the version actually running on your system.

I think taht the best way is to install “real asterisk version” There are a lot of howtos especially have a look to voip-info.org.
Afet installing it, You just have to backup your old configuration (all the files are in /etc/asterisk) and simply restore them on your new machine without reconfiguring it from scratch !

Regards

You should check if there are AGI scripts, also - if Asterisk uses any db etc.

Of cource if there are any changes in sources of “original” asterisk, they should be taken also.
It is good idea to install latest stable version. But then you have to check especially extensions.conf for usage of depercated (or no more supported) constructions.

The directories you want to back up include:

/etc/asterisk (the configuration files)
/etc/zaptel.conf (the Zaptel configuration file)
/usr/sbin/asterisk (the Asterisk binary itself)
/usr/lib/asterisk/modules (the Asterisk modules)
/var/lib/asterisk (the AstDB database, system sounds, etc.)
/var/log/asterisk (the Asterisk logs, CDR records, etc.)
/lib/modules/(kernel version)/misc or /lib/modules/(kernel version)/extra (the Zaptel kernel modules)

That should give you more than just the Asterisk configuration files.

-Jared

Thanks,

As we have a realy basic Asterisk config, i just backed up /etc/asterisk. But as i can still access to old install (i don’t scrach the HDD), i’ll see at reinstall if anything is missing.

Version is 1.1.2.7… not so up to date… :wink:

Be aware to check your conf files because there are a lot of changes between * 1.1 and 1.2.
If you need to use a 1.4.X (it’s not stupid), this question will be very important.

Regards

Hi,

Thanks again.

here is my extensions.conf[code][general]
[global]
EXTENTIONUSER
[full_plan]

include =>from_trunk_int
;include =>local

[local]
; Hint pour les telephones Snom
exten => 5001,hint,SIP/5001
exten => 5002,hint,SIP/5002
exten => 5003,hint,SIP/5003
exten => 5004,hint,SIP/5004
exten => 5005,hint,SIP/5005
exten => 5006,hint,SIP/5006
exten => 5007,hint,SIP/5007
exten => 5008,hint,SIP/5008
exten => 5009,hint,SIP/5009

include => internal_feature
include => internal_check_block_phone

[internal_check_block_phone]
; on check si c’est en interne si oui on laisse passer
exten => _XXXX,1,Goto(internal_check_dnd,${EXTEN},1)
; Pour les appels nationaux et internatial
exten => _00.,1,DBGet(phoneblock=phoneblock/${CALLERIDNUM})
exten => _00.,2,GotoIf($[ ${phoneblock} = OFF ]?external_appel,${EXTEN},1:internal_not_allowed,s,1)
exten => _00.,102,Goto(external_appel,${EXTEN},1)
; Pour les appels pour les secours et autre
include => internal_check_block_phone_sub
[internal_check_block_phone_sub]
exten => _0.,1,Goto(external_appel,${EXTEN},1)

[internal_check_dnd]
exten => _XXXX,1,DBGet(dndstatus=donotdisturb/${EXTEN})
exten => _XXXX,2,Set(EXTENTIONUSER=${EXTEN})
exten => _XXXX,3,GotoIf($[ ${dndstatus} = OFF ]?internal_check_deviation,${EXTEN},1:internal_do_not_disturb,s,1)
exten => _XXXX,102,Goto(internal_check_deviation,${EXTEN},1)

[internal_check_deviation]
; Context local, on va y definir les extentions locales
; On va regarder si il y a une deviation qui est en cours
exten => _XXXX,1,DBGet(extention=deviation/${EXTEN})
exten => _XXXX,2,GotoIf($[ ${extention} = OFF ]?internal_appel,${EXTEN},1:internal_appel,${extention},1)
exten => _XXXX,102,Goto(internal_appel,${EXTEN},1)

[internal_appel]
exten => _5XXX,1,Dial(SIP/${EXTEN},50,rwWtT)
exten => _5XXX,2,voicemail(u${EXTEN})
exten => _5XXX,102,voicemail(b${EXTEN})
exten => h,1,Answer()
exten => h,2,Playback(call-terminated)
exten => h,3,hangup()
; inclure les conferences conference avec acces externe
exten => 4001,1,Goto(conference_with_password,s,1)
; Test FastAGI
;exten => 4002,1,Agi(agi://localhost/hello.agi)
exten => 4003,1,SetLanguage(fr)
exten => 4003,2,meetme(4002)

[conference_with_password]
exten => s,1,Background(for-english-press&1&for&hello-world&2)
exten => 1,1,SetLanguage(en)
exten => 1,2,meetme(4001)
exten => 2,1,SetLanguage(fr)
exten => 2,2,meetme(4001)
[internal_feature]
; activiation de la deviation
exten => _*21.,1,DBPut(deviation/${CALLERIDNUM}=${EXTEN:3})
exten => _*21.,2,Playback(call-forward)
exten => _*21.,3,System(smssender ${CALLERIDNUM} “Forward:${EXTEN:3}”)
;exten => _*21.,3,SendText(Forward to ${EXTEN:3} Activated)
exten => _*21.,4,Hangup()
; deactivation de la deviation
exten => _#21,1,DBPut(deviation/${CALLERIDNUM}=OFF)
exten => _#21,2,Playback(call-fwd-cancelled)
exten => _#21,3,System(smssender ${CALLERIDNUM} “ACOServices”)
exten => _#21,4,Hangup()
; activiation du donotdisturb
exten => _*22,1,DBPut(donotdisturb/${CALLERIDNUM}=ON)
exten => _*22,2,Playback(do-not-disturb)
exten => _*22,3,System(smssender ${CALLERIDNUM} “DND:ON”)
exten => _*22,4,Hangup()
; deactivation du donotdisturb
exten => _#22,1,DBPut(donotdisturb/${CALLERIDNUM}=OFF)
exten => _#22,2,Playback(do-not-disturb)
exten => _#22,3,Playback(cancelled)
exten => _#22,4,System(smssender ${CALLERIDNUM} “ACOServices”)
exten => _#22,5,Hangup()
; activation du donotdisturb
exten => _*23,1,Playback(please-enter-your)
exten => _*23,2,VMAuthenticate(${CALLERIDNUM})
exten => _*23,3,DBPut(phoneblock/${CALLERIDNUM}=ON)
exten => _*23,4,System(smssender ${CALLERIDNUM} “PhoneBlock:On”)
exten => _*23,5,Hangup()
; de activation du donotdisturb
exten => _#23,1,Playback(please-enter-your)
exten => _#23,2,VMAuthenticate(${CALLERIDNUM})
exten => _#23,3,DBPut(phoneblock/${CALLERIDNUM}=OFF)
exten => _#23,4,System(smssender ${CALLERIDNUM} “ACOServices”)
exten => _#23,4,Hangup()
; TEST extention
exten => _*45,1,Answer()
exten => _*45,2,SendText(“Linux”)
exten => _*45,3,Hangup()

; //////////////////////// TEST QUEUE ////////////////////////:::
exten => 3000,1,Queue(ticketix)
exten => 3001,1,AgentCallbackLogin(||${CALLERIDNUM}@internal_appel)
exten => 3002,1,AgentCallbackLogin(||l)

[internal_do_not_disturb]
exten => s,1,Background(extension)
exten => s,2,SayDigits(${EXTENTIONUSER})
exten => s,3,Background(is&unavailable&press-1&for&voice-mail-system&press-2&for&goodbye)
exten => 1,1,voicemail(u${EXTENTIONUSER})
exten => 2,1,Hangup()
[internal_not_allowed]
exten => s,1,Playback(auth-incorrect)
[external_appel]
exten => _0.,1,Dial(SIP/${EXTEN:1}@voipbuster,r)
exten => _0.,2,Hangup

;[from_trunk_int_c]
;exten => _6xxx,1,Dial(IAX2/totrixboxb/${EXTEN})
;include => from_trunk_int

[from_trunk_int]
exten => _1xxx,1,Dial(IAX2/totrixboxa/${EXTEN})
include =>local
[/code]

If you are happy with the asterisk and the os, you might consider trying to clone the entire thing.

I have a bunch of little black box asterisk servers that are all the same disk wise. I can boot each one up with a gentoo disk, and dd the raw disk into ssh and back onto the new disk, and wind up with a byte for byte clone when I am done. Don’t even need to muck around with partitioning.

When you have different hardware the game is similer, but you use tar instead. You also need to partition the new disk(s) and mount the partitions, then just tar into ssh and untar from stdout. Make sure the cloned fstab uses the correct lables or devices. You might need to label the new partitions, or change the device names. Then install grub, and you are good to go.

The gentoo disk is handy because it has all the tools you need on it. Boot each box up from one so the hard disk is idle whilst the cloning is taking place.

[quote=“Matthew_kleinmann”]If you are happy with the asterisk and the os, you might consider trying to clone the entire thing.

I have a bunch of little black box asterisk servers that are all the same disk wise. I can boot each one up with a gentoo disk, and dd the raw disk into ssh and back onto the new disk, and wind up with a byte for byte clone when I am done. Don’t even need to muck around with partitioning.

When you have different hardware the game is similer, but you use tar instead. You also need to partition the new disk(s) and mount the partitions, then just tar into ssh and untar from stdout. Make sure the cloned fstab uses the correct lables or devices. You might need to label the new partitions, or change the device names. Then install grub, and you are good to go.

The gentoo disk is handy because it has all the tools you need on it. Boot each box up from one so the hard disk is idle whilst the cloning is taking place.[/quote]

As the hardware is completly different, i didn’t even think about that, but as i did an image disk with Clonezilla, i’ll try to restore this image and check if i get a kernel panic or if it’s working… Thanks for the tip.

Nico