Solved

backup one sql server db to another sql server

Posted on 2008-06-15
10
196 Views
Last Modified: 2010-03-19
I have two SQL servers at two remote locations.  Two different IP address locations to be exact.  How can I back up on db to the other either through SQL or through using VB6?
0
Comment
Question by:al4629740
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 19

Expert Comment

by:elimesika
ID: 21789560
HI

lets mark DBs ar dbsource and dbtarget

Follow :

1)  from MSMS on source machine detach dbsource
2) from MSMS on target machine detach dbtarget

3) copy db file + log from source machine to target machine using ftp (backup original files)

4) attach dbtarget

5) attach  dbsource
0
 
LVL 60

Accepted Solution

by:
chapmandew earned 500 total points
ID: 21789627
Actually, in this case you do not want to detach and attach, since you're not moving them...and you likely want to keep your source server online.  Do this instead:

1.  backup the database that you want to copy to a file.  (BACKUP DATABASE statement)
2.  Copy that backup file (.bak) to the server you want to move it to
3.  Restore the database that you just copied to that server (RESTORE DATABASE statement)
0
 

Author Comment

by:al4629740
ID: 21789688
(BACKUP DATABASE statement)

what statement do I put in for example?
0
Backup Solution for AWS

Read about how CloudBerry Backup fully integrates your backups with Amazon S3 and Amazon Glacier to provide military-grade encryption and dramatically cut storage costs on any platform.

 
LVL 60

Expert Comment

by:chapmandew
ID: 21790038
backup database yourdatabasename
to disk = 'c:\pathtowhereyouwanttoputbackupfile\backup.bak'
0
 

Author Comment

by:al4629740
ID: 21790088
If I was going to restore it over the internet to another location (sql server) how would I then restore it? example?
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 21790537
backup database yourdatabasename
to disk = \\servername\sharedpath\backup.bak'
0
 

Author Comment

by:al4629740
ID: 21790662
My target server is behind a router, how does this happen?  I access it via a connection string through port 1433.

x.x.x.x:1433
0
 

Author Comment

by:al4629740
ID: 21807894
I get this error
Msg 3201, Level 16, State 1, Line 1
Cannot open backup device 'C:\BackupIllinoisDB\backup.bak'. Operating system error 3(The system cannot find the path specified.).
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 21809776
Did you copy your backup to the server so it is actually on the C: drive of the server that you want to restore it to?
0
 

Author Comment

by:al4629740
ID: 21809782
it was backed up to a backup folder, the same C drive as the source.  For testing right now.
0

Featured Post

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Send outlook email from VBS Script 2 58
Fastest way to find and count same items VB6 16 43
SSMS Imprt data from Excel 7 20
Parsing this XML works but the other one doesn't 9 27
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

761 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question