Asterisk server replication, please help!

I need to migrate my Asterisk dialplan, voicemail messages, and sound files (I have some custom ones) from my current Asterisk box to a new server. I can’t find instructions for how to do this anywhere. Reconfiguring the dial-plan won’t be very difficult if I have to do it manually (via copy and paste) but I have no idea how to migrate the messages and greetings from one computer to another while keeping all the relationships intact. (i.e. moving extension 302’s recordings and messages from the current box to the newly-created one.)

Does anyone know where I can find documentation describing how to make this type of transition? I’m using FreePBX on Asterisk 1.2.10. Thanks!

Hey there,

I’ve never used FREEPBX before, but I do that kind of thing all the time, and what I end up doing it just backing up the etc/asterisk, /var/lib/asterisk/sounds and /var/spool/asterisk/voicemail directories.

I personally use SCP to copy them over to the new box after TARing them up, but writing them to CD/DVD would be just as effective if they are an appropriate size.

If your linux foo is not very large yet, do the following:

  1. Get to a console. (Not sure how in FreePBX, but Im sure its possible)
  2. Log in as root, or some other power user with rights to those directories
  3. Type ‘tar -zcvf etcasterisk.tgz /etc/asterisk’
  4. Type ‘tar -zcvf sounds.tgz /var/lib/asterisk/sounds’
  5. Type 'tar -zcvf voicemails.tgz /var/spool/asterisk/voicemail

This will create you 3 files that you can download with your information that you need. You can then log in with FTP (if a FTP daemon is running) or use SCP (‘scp etcasterisk.tgz root@NEW_BOX_IP:/tmp’) to copy the files over.

This is just one way to do it. Kind of seems like a pain in the butt, however once you get the hang of it it goes by really quickly.

Hope this helps !

Thanks so much for your response! So doing this retains all of the voicemails, greetings, and keeps them intact? If it does, you’ve just made my life a million times easier.

Yes, the dialplan is kept in /etc/asterisk along with all of the other sorted files. The voicemails are kept in /var/spool/asterisk/voicemail and the sounds are most often kept in /var/lib/asterisk/sounds. Confirm that your sounds are kept in these default locations, but backing up those three directories should be all you need to do.

Hope all goes well for you !

Hi

As you are using freepbx you will be in trouble just copying /etc/asterisk as many of the files are rewritten on a reload of freePBX, you will need to migrate the database first reload it then copy over the voice and sound files.
Making sure you keep the permissons correct.
Im sure there are tools outhere on the freepbx or even trixbox site.

Ian

Thanks for the help, astmonkey! I’ll make sure to file this away.

Ian: Yeah, it took me a while to get used to how FreePBX deals with the dialplan. I have my custom.conf files saved, so I should be fine there. I was mostly just concerned that my voicemails and greetings relationships were stored in a mysql table–and I know nothing about mysql. But it looks like asterisk just polls the existing directories for the greetings and messages, so a copy and paste should let the voicemails work just fine, and then i’ll re-upload the sounds into freepbx’s databases. Thanks for your concern!