sam32 — 2012-09-25T17:08:07-04:00 — #1
I'm wondering about an efficient way to copy a live database into a test database at intervals of 3 months.
Currently, I'm manually deleting the test database and copying each table of the live database into a new test database by mean of a PHP script.
Is it possible to schedule a job to take care of this task for instance?
Thanks in advance.
spacephoenix — 2012-09-25T20:12:37-04:00 — #2
If you're using a linux box then you should have cron jobs available to you
cpradio — 2012-09-26T05:49:31-04:00 — #3
In conjunction with using mysqldump and the mysql commands.
r937 — 2012-09-26T06:33:47-04:00 — #4
assuming it's a mysql database, of course
cpradio — 2012-09-26T07:04:54-04:00 — #5
Of course, and if it is SQL Server, and you are running 2005 or higher, you can write an SSIS task that will perform the task for you and set it up using a Job so it runs every 3 months.
sam32 — 2012-09-26T16:11:02-04:00 — #6
Is there any alternatives to mysqldump? It seems to be a bit slow.
spacephoenix — 2012-09-27T02:49:22-04:00 — #7
When you're copying across the data manually are you using a select insert query?
cpradio — 2012-09-27T05:37:33-04:00 — #8
Have you tried looking at the flags you can set? Can you show us the command you were running (without the username and password, of course)
sam32 — 2012-09-28T15:20:00-04:00 — #9
I made a simple test with the standard command.
mysqldump -u username -p password db_name > dump.sql
The dump file is stored in the same I/O drive which might be causing extra delay.
The only option I have is to compress the output.
mittineague — 2014-09-18T22:21:15-04:00 — #10
This topic is now archived. It is frozen and cannot be changed in any way.