tbm-backup and how to restore on another server?

aussieboi21
Posts: 33
Member Since:
2007-05-06

Hey Guys,

I have just been hunting around for the last hour to find the answer to this question without much luck.

If I create a backup file using tbm-backup where do I have to put this backup tar.gz file on a different Trixbox server in order for the backup system to be able to see the backup file from the old server and therefore then be able to restore it? I have tried creating a new backup schedule on the new server, and copied the backup tar.gz file from the old server there but it still doesn't show up under the "Restore" tab - the only ones that seem to show up there are ones that are created on that server.

Also is it possible to delete backup schedules from the interface, or do you have to do a SQL hack job to get rid of them?

Anyone able to point me in the right direction?

Thanks heaps!
Luke.



antidelldude
Posts: 287
Member Since:
2009-05-18
tbm-backup needs some work, but it does the job.

Lucky you I just went through this and also found documentation on it to be lacking.

How-To restore a trixbox backup from one server onto a new server. FYI: DO NOT RENAME THE BACKED UP FILE FROM THE OLD SERVER.
Take the backup file from the old trixbox server and save it somewhere the new trixbox server can get access to it (ftp or ssh is easiest in my opinion).
Create a backup job on the new trixbox server, to keep this simple, name it backup and don't define a location.
Run the backup job so it'll create the necessary directory structure. WAIT FOR IT TO FINISH!
Transfer the backup from the old server to /backups/backup on the new server.
Go to something else in the menu, like system status, then go back into the backup module to force a refresh.
Click on the backup job named backup (or whatever you named it if you didn't take my advice), wait about 20 seconds, and on the restore tab, you should see the name of the backup that you transferred from the old server. Click on it, check everything you want to restore, and restore it.
Once restored, you will need to delete the duplicate cron jobs it creates AND repair any broken/missing modules in the module admin.

How-To remove duplicate cron jobs.
It's a tiny bug that is easily dealt with. Every time you restore, it DOES NOT erase the old cron job while it is restoring the backed up cron job. You do only need one instance running. The easiest way of course would be to hop into webmin and delete the duplicate cron jobs from there. System>>>cron

The way to do it via ssh or terminal
Type crontab -e
Hit i
delete all of the duplicate lines. If there are two(three, four, five, you get the point) lines that look exactly the same, delete every line but leave one behind, you still need once instance of the cron job.
Hit esc
hit :
and type wq

You're good to go. You will have to do this until the bug is fixed. Not really a big issue, it does a fairly good job at restoring. One other bug I'd like to note. If you assign caller id's by extension, the restore process will restore the caller id information to the extension, but it will not be applied until you go into each extension and click submit then apply changes.

How-To remove a backup job.
There currently is not a way to do this from the tbm-backup module, you will have to shuffle through phpmyadmin (it is tbm-phpmyadmin that can be installed from the packages section)
Click on the asterisk database
Click on the backup schedule table
Click browse
Click the red X next to the entry you want gone

It isn't severely hard to add an option to delete the jobs. You never know I may even make the change. I'm a n00b at php and mysql but I have done similar things before.

Let me know if it works, I made those directions on the fly and may have forgotten something. If it works out for you, this may be something to add to the wiki.

--

Regards,
Jon
Please respond if your problem was ever solved, and how you solved it. It'll help the next guy.



aussieboi21
Posts: 33
Member Since:
2007-05-06
Thanks! Will try it out tomorrow

Thanks Jon! Awsome responce! :-) will give it another try tomorrow and let you know!

One other question for you though... have you had any experience restoring on a server that is running a newer version of Trixbox? Like 2.6.1.11 backup restored on a 2.8.0 server? By the looks of the reading I have been doing people haven't had much luck unless the versions match between servers.

Thanks again will give it a try tomorrow!

Luke.



antidelldude
Posts: 287
Member Since:
2009-05-18
A few more things can be broken

I have attempted a restore from 2.6.2.1 to 2.8.0.1. After you hunt down all the configs it kills, and all the modules it kills, you can get it to work, you just need to be patient. Just so you aren't pulling your hair out, CDR, FOP, Hudlite, yum update, already had issues before you ran the restore. I'm sure there are others as well, but I can't think of any right now.

--

Regards,
Jon
Please respond if your problem was ever solved, and how you solved it. It'll help the next guy.



antidelldude
Posts: 287
Member Since:
2009-05-18
READ THIS before directions above

One further add-on to the directions above, BEFORE you delete the row, write down it's backup_id. Then you can delete the row.
But, for the sake of my OCD of having spotless databases. You can then go to the backup_item table and delete everything with a item_schedule_id that matches the backup_id that you wrote down. It's not needed, but you know... spotless.

I take back what I said. "It isn't severely hard to add an option to delete the jobs." If it was written in just PHP with mysql, I may have been able to accomplish it with a day of hair pulling *cough* I mean learning in a similar way my delete feature works over at tinyvent.com. But after digging into it, they use ajax in the mix as well. That's waaaaaaaay over my head. Guess we'll have to wait for someone smarter than me to step up to the plate, or for me to take up ajax... A race to the finish it is.

--

Regards,
Jon
Please respond if your problem was ever solved, and how you solved it. It'll help the next guy.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.