How to move a SQL Server Database from One Server to another server

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2006
Posts: 32
Reputation: sierrasoft is an unknown quantity at this point 
Solved Threads: 0
sierrasoft sierrasoft is offline Offline
Light Poster

How to move a SQL Server Database from One Server to another server

 
0
  #1
Feb 4th, 2009
How to move (or Duplicate) a Microsoft SQL Server Database from One Physical Server to another server (like backup) in vb.net 2.0 ?
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 63
Reputation: 4advanced is an unknown quantity at this point 
Solved Threads: 10
4advanced 4advanced is offline Offline
Junior Poster in Training

Re: How to move a SQL Server Database from One Server to another server

 
0
  #2
Feb 4th, 2009
There are a few options but one of the simplest is to detach the database from the server, copy the phisical files to the new dataserver's datapath and attach it to the new dataserver.

For those actions you have to import Microsoft.SqlServer.Management.Smo.SmoApplication and use the EnumAvailableSqlServers() to find the available sql servers (from MSDE2000 up to SQL2008).

Found the correct server, you can call sp_attach_db on an active connection and include the correct physical-filenames (for the mdf & ldf file) to attach it.....

Regards,

Richard
The Netherlands
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 147
Reputation: samir_ibrahim is on a distinguished road 
Solved Threads: 16
samir_ibrahim's Avatar
samir_ibrahim samir_ibrahim is offline Offline
Junior Poster

Re: How to move a SQL Server Database from One Server to another server

 
0
  #3
Feb 6th, 2009
Originally Posted by sierrasoft View Post
How to move (or Duplicate) a Microsoft SQL Server Database from One Physical Server to another server (like backup) in vb.net 2.0 ?
First, Move is totally different from Duplicate
Move is deleting DB from first server and put it is second server
Duplicate is both server having the same DB
So,
First you choose which one you want (Move or Duplicate)
Second, you want to do that by vb.net coding or manual?
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: How to move a SQL Server Database from One Server to another server

 
0
  #4
Feb 6th, 2009
When dealing with servers (which are usually important to the company) the safest way to move the database, is to duplicate it first.... then later remove it from the source. So while you are right, moving and duplicating are different.... would you think it is wise from an administration point of view to move the data? No. You duplicate the data... then if everything goes well, you delete the old data. So, assuming we are people who have server administration experience (could be a big assumption), I'd say it's a safe bet to not even talk about the act of "moving" data directly.........
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 147
Reputation: samir_ibrahim is on a distinguished road 
Solved Threads: 16
samir_ibrahim's Avatar
samir_ibrahim samir_ibrahim is offline Offline
Junior Poster

Re: How to move a SQL Server Database from One Server to another server

 
1
  #5
Feb 6th, 2009
Hi Comatose

Originally Posted by Comatose View Post
When dealing with servers (which are usually important to the company) the safest way to move the database, is to duplicate it first....
That is not necessary.
De-Attach and Attach are safe method and you can do it with no fear of data lost unless the database you want to move has a replication.

then later remove it from the source. So while you are right, moving and duplicating are different.... would you think it is wise from an administration point of view to move the data? No. You duplicate the data... then if everything goes well, you delete the old data.
I agree, always take a backup before doing such thing

There is three kind of copying/duplicating the DB from one server to another. Backup/Restore,De-attach/Attach, Copy Directly from source to destination.
Each one has it is own characteristics and depends on the situation(error in replication, server hardware failure, etc..) he should choose which one he should use.

So, assuming we are people who have server administration experience (could be a big assumption), I'd say it's a safe bet to not even talk about the act of "moving" data directly.........
I have Microsoft certificate in MSSQL Server Admin in 2003 ad I have 8 years of experience in SQL Server Administrator
Last edited by samir_ibrahim; Feb 6th, 2009 at 11:36 am.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC