473,387 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Need a script to backup db on one server and restore that db to another server

I need to what is the best way and how to create a script or procedure where I can create a backup of a database on one server(production) and restore that database onto another server(test). The database currently exists on both servers but I want to keep the data on test up to date with production server. Does anyone know the best way to do this and possibly how to do this.

Thanks
Oct 1 '09 #1
4 1688
ck9663
2,878 Expert 2GB
One word: REPLICATION

Good luck!!!

--- CK
Oct 1 '09 #2
@ck9663
I am probably gonna need a little more assistance then this. What do I do in Replication? Does replication build a sql backup script for the database on a prod server that I can restore into a database on a test server
Oct 1 '09 #3
ck9663
2,878 Expert 2GB
It replicates your database into multiple subscribers. Depending on the setting, you may sync the subscribing database every x frequency.

If the DB is small, you can just backup your production DB, and restore it as a testDB.

--- CK
Oct 1 '09 #4
JamieHowarth0
533 Expert 512MB
In the old days, this kind of job would be a multi-step DTS (Data Transformation Services) transaction, where you would run a SQL script that backed up the database, then ran a shell command to FTP the backed-up database to the new server. On the receiving server, you'd have another DTS job to check for a new file received via FTP in a certain folder - once the file exists, you'd then run a SQL statement to restore it.

This functionality is now handled by SSIS (SQL Server Integration Services) from SQL Server 05 onwards and requires Workgroup Edition or above (won't work on Express). I'm not too familiar with it, but MSDN's comprehensive online reference guide should be a good place to start. Failing that, looking at replication (which you can find details on via the above link) would be the other option. Bear in mind your test server has to be Internet-facing for any such solution to not require manual intervention at some stage in the transfer process.

Hope this helps.

codegecko
Oct 1 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: EggsAckley | last post by:
Hi: I have a file that I have been told is a SQL Server backup from a server somewhere. The file is about 200MB in size I am trying to create the database on my local server using RESTORE. I...
2
by: Vikrant | last post by:
Friends, I have read DB2/UDB 8.x 'RESTORE DATABASE Command', with my 'limited' knowledge & skill. I think it should address my concern, but I want advice/ opinion / experience and any care I...
1
by: Fabius | last post by:
Hello, i'm trying to transfer a DB2 database from a PC to another. Following suggestion that Mr. Jan M. Nelken and Mr. Pierre Saint-Jacques give me on this newsgroup i first made a backup of...
5
by: HSP | last post by:
hi. i need to restore an old database. The db was backed up using a DLT drive, using 2 volumes. The content for the tapes was copied to file onto Solaris machine using rsh and dd (for backup...
0
by: raj.raghavan | last post by:
Hi, I have a database were all the indexes are in a seperate filegroup a few large tables are in a seperate filegroup. We take backup at different times and I have backup of primary, two filegroup...
5
by: abelbfilho | last post by:
I have a backup image with name DADOSADV.0.DB2.NODE0000.CATN0000.20060812230006.001 and I want to restore it on Windows (in another server). In Windows Server I created this folder structure:...
9
by: gabe101 | last post by:
I've searched enough to know that this ability probably doesn't exist in our current setup, thus the reason I'm coming to the community now. When doing a database backup in Enterprise Manager (SQL...
5
by: smoi | last post by:
Hi all, My manager ask me to do backup for 3 database and restore them in a new server. I did the backup for the 3 database into BAK file. Then in the new server, when I did the restore in SQL...
4
by: Christian Maslen | last post by:
Hi All, I understand in older versions of DB2/UDB this was not possible. The following article explains how I might do this ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.