all groups > sql server new users > june 2006 >
You're in the

sql server new users

group:

How to get a db backup to another server?


How to get a db backup to another server? JDP NO[at]SPAM Work
6/21/2006 11:17:24 PM
sql server new users:
Best practices to get a db backup to another server.

I've got as far as working with an ActiveX task Workflow to use an FSO, but I'm
stalled at doing a date comparison to get the latest backup copied.

I had tried to simply copy the one and only backup file in a folder to the other
server and then copy the backup file to a local folder to maintain a few days
backups locally, but then I had to make some sort of process to remove files
after a period of time.

What I'd really like to keep is the following.

On the production server a few days backups

On the remote server I would like to have two weeks of backups, and keep a
backup for each month, and then maintain one backup per quarter.

Currently I have the system make a backup each evening, then one at noon each
day. I'd like each of these to be copied to the reserve server that will also
function as an application server, this is a 25 user environment, heavy
procssing, but this has been in production for nearly 10years with less
processing power than we currently have so the performance is acceptable.

Any directions would be appreciated.

JeffP....


Re: How to get a db backup to another server? Steen Persson (DK)
6/22/2006 9:35:50 PM
[quoted text, click to view]
Hi Jeff

I think the easiest solution, is to give you files a name that contains
the date. When you then want to delete files that are e.g. 2 weeks old,
you just "contruct" a file name that are today's date - 14 days.
There can be cases though where a file isn't deleted - e.g. if your
job isn't running a day then the file that are 14 days old from that day
won't be deleted. You could then manually once in a while check the
folder and delete the left over files. Others might have better and more
clever ideas to this, but that might require programming skills to
something else than SQL (...which I haven't got...:-)...).


--
Regards
Steen Schlüter Persson
Re: How to get a db backup to another server? Andrew Hodgson
6/23/2006 10:46:18 PM
On Wed, 21 Jun 2006 23:17:24 -0700, "JDP@Work"
[quoted text, click to view]

This is a bit messy, but I tend to use batch files for this sort of
task. Do a google on the forfiles command, as it lets you remove
files earlier than a certain date. The rest can be done by using
either robocopy or rsync, for example:

Do a scheduled backup
Robocopy backup directory to backup server (only new files get
copied), do not use mirror mode, so files build up on the backup
server.
Run a forfiles job which deletes files from backup server for specific
dates.

I tend to run the copy job on the backup server as all the items can
be ran from one bat file.

Rsync is very good, however, where you have just the one addition to
the directory between jobs it may as well be best to use Robocopy -
Rsync can gain when your existing files change accros jobs.

Hth.
Andrew.
--
Andrew Hodgson in Bromyard, Herefordshire, UK.
AddThis Social Bookmark Button