tar -zcvf etcasterisk.tgz /etc/asterisk
tar -zcvf sounds.tgz /var/lib/asterisk/sounds
tar -zcvf voicemails.tgz /var/spool/asterisk/voicemail
tar -zcvf tftpboot.tgz /tftpboot
tar -zcvf etcdahdi.tgz /etc/dahdi
This will create files that can be transferred to the new PBX.
scp {etcasterisk.tgz,sounds.tgz,voicemails.tgz,tftpboot.tgz,etcdahdi.tgz} root@new.pbx.server:/
This leaves the archives in the root of the new PBX.
Log into the new PBX as root and extract the archives.
/etc/asterisk
in its entirety to its original location. It will probably break things.
At a minimum, create a backup of the existing files before extracting:
cp -avr /etc/asterisk /etc/asterisk.bak
cd / tar -xzvf sounds.tgz rm sounds.tgz tar -xzvf voicemails.tgz rm voicemails.tgz
If you want to extract the files to a temporary location:
mkdir /root/asterisk_backup mv etcasterisk.tgz /root/asterisk_backup cd /root/asterisk_backup tar -xzvf etcasterisk.tgz
Finally, a word about permissions. You will want to check that the newly extracted files have appropriate permissions. They may need to be adjusted to something similar to this:
chown -R asterisk.asterisk /var/lib/asterisk/sounds chown -R asterisk.asterisk /var/spool/asterisk/voicemail find /var/lib/asterisk/sounds -type d -exec chmod 775 {} \; find /var/lib/asterisk/sounds -type f -exec chmod 664 {} \; find /var/spool/asterisk/voicemail -type d -exec chmod 775 {} \; find /var/spool/asterisk/voicemail -type f -exec chmod 664 {} \;
There are two sound file directory layouts in existence. The new way has alternate languages in their own subdirectory of /var/lib/asterisk/sounds
.
If you see errors such as:
[2011-11-21 10:25:33] WARNING[9730]: file.c:665 ast_openstream_full: File digits/1 does not exist in any format [2011-11-21 10:25:33] WARNING[9730]: file.c:992 ast_streamfile: Unable to open digits/1 (format 0x4 (ulaw)): No such file or directory
first check for the existence of the sound files and the permissions. Then check this setting in /etc/asterisk/asterisk.conf
:
languageprefix=yes