Click to See Complete Forum and Search --> : Need help copying a live database


pmrphs2002
08-29-2008, 01:30 AM
Hey all!

Im working on a project at work, and can't seem to plug the right bits together...

On terminals in a satelite office, we have LimeSurvey freshly installed and running in Firefox kiosk mode as basically a suggestion box. Simple small questionaire. But - there isn't a time interval to it being removed - it's set up to run forever, and expand to other offices depending on how well this goes.

My issue lies in NOT being a database guy- we need to grab the database off of these terminals on a regular (at least once a week) basis, and be able to extract the data to our own database to act on our feedback.

So - my thoughts (where you guys can come in to rightfully call me an idiot ;-) ) is to somehow chron a database dump. At a specific time at night, have our fileserver RSync it, and store it so the HR people can access it.

Sorry for the long winded introduction, but my questions are:

1) How can I set out to automatically dump the database into something useable?

2) Once its in a file, there should be anything wrong with RSyncing through an SSH tunnel, right?

3) Once its in the hands of HR, how do they re-inflate the database without it being a garbled mess?

LimeSurvey is installed on a LAMPP server on the kiosks if it helps

Thank you all in advance...
Pete

** Edited because its late, and my grammar wasn't so hot. **

gamblor01
08-29-2008, 08:54 AM
I was going to ask what type of DB you are using, but then I saw LAMP...so I'm going to assume that's MySQL. What you are probably going to want to use is either the mysqldump or mysqlhotcopy commands. Just do a google search for them and you should be able to find links to the manual pages describing them on mysql.com. This link has a few examples of how to use mysqldump:

http://articles.techrepublic.com.com/5100-10878_11-5259660.html

Try searching this forum as well, as this question has been asked quite often. There are plenty of examples of how people ran the mysqldump command, and how to restore it on another machine, etc.

So, to answer your questions:

1) mysqldump or mysqlhotcopy

2) I don't think this is going to be an issue. The file on the target machine(s) should not be a garbled mess simply because it was transferred via ssh. The communication is encrypted but the file itself should be identical to the original and therefore, readable.

3) See the link above but basically you just run the command 'mysql' and then redirect the file as input:

mysql (some options here) < dumpFile.sql

pmrphs2002
08-29-2008, 11:06 AM
Thank you very much for the direction-

I'd been doing dumps via PHPMyAdmin ... Obviously not a long term solution! To Google I go!