** Update - SugarCRM Stores info in it's Apache directory - Now included **
There are several excellent articles here about Mondo and such for complete backups - this is a procedure for a more stripped-down Backup and Restore - just the data you need, not an image of the whole box:
Backing up Everything on your Trixbox 2.2 so you can restore it.
This is the procedure I use when I am trying to make a complete backup of a machine in preparation for moving it to different hardware, or just a complete backup for disaster recovery. Mondo is also a killer way to do this, but the advantage of doing it this way is that you have the individual components and can restore only the pieces that you want to move to the new machine. I will be giving the actual keystrokes from the console.
1) Go into FreePBX and create a Complete Backup named now - Select EVERYTHING
1) cd /usr/src - any working directory - I like this one.
2) mkdir move - I like an empty directory to work in.
3) cd move - go there.
4) cp /var/lib/asterisk/backups/now/* . - copy the backup you just created here to the working directory.
4) service mysqld stop - we are going to be backing up the databases, and we don't want open files getting in the way.
5) tar -czvf tftpboot.tar.gz /tftpboot/ - copy your tftpboot directory here.
6) tar -czvf sugarcrm.tar.gz /var/lib/mysql/sugarcrm/ - copy your SugarCRM database here.
7) tar -czvf endpoints.tar.gz /var/lib/mysql/endpoints/ - copy your endpoint database.
8) tar -czvf sugar-web.tar.gz /var/www/html/crm/ - Get the SugarCRM Web Directory
9) service mysqld start - restart it if you are going to keep using the old machine.
At this point, a directory should look something like this:
[root@asterisk move]# ls -alh
total 61M
drwxr-xr-x 2 root root 4.0K Dec 5 20:45 .
drwxr-xr-x 13 root root 4.0K Dec 5 20:38 ..
-rw-r--r-- 1 root root 38M Dec 5 20:39 20071205.20.38.05.tar.gz
-rw-r--r-- 1 root root 6.8K Dec 5 20:45 endpoints.tar.gz
-rw-r--r-- 1 root root 1.8M Dec 5 20:44 sugarcrm.tar.gz
-rw-r--r-- 1 root root 22M Dec 5 20:39 tftpboot.tar.gz
-rw-r--r-- 1 root root 38M Dec 5 20:48 sugar-web.tar.gz
There are several ways to move this off of your machine - you could use WinSCP if you are a Windows-Type, or you could FTP it off the machine (my preferred method) to get it to a place where when the new box is up and running, you can then copy the files back and restore.
Restoring is quite simple:
1) For the FreePBX backup, just go into FreePBX, create a backup job called now, and then move the file starting with 2007 (the first file listed) back into it's proper directory (/var/lib/asterisk/backups/now/) and you will be able to restore it.
2) For the Endpoints and SugarCRM backups, just stop mysqld and then expand the tar files right over top of the existing directories and when you restart mysqld, it will use the restored data.
3) For the tftpboot directory, install any firmware-x packages and configure them BEFORE you then expand the tarball over top - you want it back to the way you had it.
You could also very easily make this into a bash script, and then schedule it as a CRON job - because you are just dealing with the individual components, it is pretty straight forward.
You could also use this procedure to move from 2.2 to 2.4 with the exception of SugarCRM - I am going to see if I can rip the SugarCRM script and package out of the 2.2 .ISO and make it work on 2.4 - I will post it here when I have it working.
Trixbox is VERY flexible and forgiving when it comes to moving from machine to machine - hope this helps.
Greg
Member Since:
2006-11-19