How to move databases between computers that are running SQL Server

Rate It (2)

Last post 10-25-2009 1:34 PM by ajitsatpathy. 19 replies.

Sort Posts:

  • How to move databases between computers that are running SQL Server

    11-06-2006, 2:37 PM
    • All-Star
      26,551 point All-Star
    • Caddre
    • Member since 06-23-2003, 9:53 AM
    • Indy
    • Posts 5,308

    I recommend Backup and Restore because it also move your permissions, there is a known issue of orphaned permissions, meaning the permissions are created in the Master database but not in your database. The quick solution delete the restore and create a new one. Please download and read the free backup and restore chapter from SQL Server 2005 a beginner’s guide.

    If you use another method remember to check your permissions if they were not moved you need to follow the direction in the section dealing with moving your logins. Hope this helps.

    http://support.microsoft.com/kb/314546/en-us

    http://books.mcgraw-hill.com/getbook.php?isbn=0072260939&template
    Kind regards,
    Gift Peddie
  • Re: How to move databases between computers that are running SQL Server

    05-13-2008, 7:13 PM
    • Contributor
      2,184 point Contributor
    • devcalpoly
    • Member since 10-08-2007, 10:03 PM
    • Southern California
    • Posts 352

    Detach and attach will also work. Using T-SQL or Wizards.

     

    Dev
  • Re: How to move databases between computers that are running SQL Server

    05-29-2008, 2:43 AM

    If you want simply transfer  just generate  script and transfer through DTS.

  • Re: New Subject

    06-19-2008, 4:32 PM
    • Member
      96 point Member
    • byte4321
    • Member since 06-03-2008, 2:03 PM
    • Posts 153

    Right click on database and export the tables to new server/database.

    Don't forget to Mark this as "Answer" if my response helps you...!!!!
  • Re: How to move databases between computers that are running SQL Server

    12-11-2008, 6:08 PM
    • Contributor
      3,472 point Contributor
    • rami_nassar
    • Member since 10-07-2008, 7:01 AM
    • U.A.E.
    • Posts 788

    I'm using attach and deattach in my work... and sometimes exporting scripts

    Regards...
    Nassar, Rami (MCP, MCTS)
    My Blog || E-Mail

    Don't forget to click "Mark as Answer" on the post that helped you.

    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
  • Re: How to move databases between computers that are running SQL Server

    12-17-2008, 12:51 AM
    • Participant
      1,095 point Participant
    • avinash_vns
    • Member since 12-16-2008, 9:21 AM
    • Mumbai
    • Posts 230

    There are many way to transfer running database.

    1- Using backup restore.

    2. Using Replication.

    Detach and Attach  is not the right way because there is chance of data loss.

    Avinash 

     

    Regards,

    Avinash

    Please don't forget to click "Mark as Answer" on the post that helped you.
  • Re: How to move databases between computers that are running SQL Server

    12-25-2008, 12:46 AM
    • Contributor
      7,266 point Contributor
    • sirdneo
    • Member since 12-16-2008, 5:45 AM
    • Karachi, Pakistan
    • Posts 1,141

     Attaching/Deattaching works fine on first build at production or Q/A. But whenever I fix bug I create scripts to update the production database.

    Thanks,
    Zeeshan Umar

    ~Please Mark As Answer, if one or multiple posts, which helped you in your problem. So that it might be useful for others~

    My Blog
  • Re: How to move databases between computers that are running SQL Server

    01-05-2009, 11:32 AM
    • Contributor
      3,472 point Contributor
    • rami_nassar
    • Member since 10-07-2008, 7:01 AM
    • U.A.E.
    • Posts 788

    Deattach and Attach database from SQL Server Managment Studio...

    Regards...
    Nassar, Rami (MCP, MCTS)
    My Blog || E-Mail

    Don't forget to click "Mark as Answer" on the post that helped you.

    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
  • Re: How to move databases between computers that are running SQL Server

    02-04-2009, 9:54 PM
    • Member
      12 point Member
    • TapeBoy929
    • Member since 01-29-2009, 4:44 PM
    • Posts 6
    If you're looking to copy the database, you don't have to use backup/restore or detach/attach.  You can use the copy database feature.  This will capture the data, logins, and stored procedures.  Try it out.  Good luck.
    Ranjit Viswakumar
    Professional Services Specialist
    HostMySite.com
  • Re: How to move databases between computers that are running SQL Server

    03-04-2009, 7:17 AM
    • Member
      518 point Member
    • arry.net
    • Member since 07-04-2008, 9:42 AM
    • Posts 136

     just do this

    Go to Run->Cmd->

    write->Net Stop Mssqlserver (or just shut down ur sqlserver 4 a while from

    SQL Server Configuration Manager)

    (After ,it has Stopped)
    Go Tothis Direcrtory:-----

     

    C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data

    here in data 2 files of ur database are stored(in my case Tradenbids)

    1. Tradenbids.mdf

    2.Tradenbids_log.ldf

    Copy these to file 

    and paste  whaere ever you want

    Now 

    Go to Run->Cmd->

    write->Net Start Mssqlserver (it will start mssqlserver)

    now u have the whole   db , just copy and paste these to file whenever u want a backup

     

     

    arry.net
  • Re: How to move databases between computers that are running SQL Server

    03-23-2009, 12:20 AM
    • Member
      2 point Member
    • kanth456
    • Member since 03-20-2009, 7:46 AM
    • Posts 1

     hi,

     am  srikanth.i have two databases one at source and other at target with same structure .i want to track the changes of dml operations of tables and convert this into Xml file and that should be sent through email and updated to database how to solve this problem please reply it to my mail kanth456@in.com

  • Re: How to move databases between computers that are running SQL Server

    05-13-2009, 7:16 AM
    • Member
      39 point Member
    • vineetJAISWAL
    • Member since 01-15-2009, 11:31 AM
    • New Delhi
    • Posts 39

     Why are you not  using Import/Export if your system is connected in LAN, other wise you can use backup and restore option which take all your permisson, Identity, Defaultvalue as per your master database.

     

  • Re: How to move databases between computers that are running SQL Server

    05-14-2009, 7:03 AM
    • Participant
      804 point Participant
    • soumendu
    • Member since 04-01-2009, 1:00 PM
    • bangalore,karnataka,india
    • Posts 130

     Hi ,see

    If  u system is in local area connection(& in both the master & slave contain same formated server with same OS configuration) i think u can easily transfer the data(sometimes back i was at same confusion) the i take my senior help & u cannot even imagin that i tranfer througn external hard drive(by copying from the source & moving to any other ).so Yes .And if u still facing prob. then u can go for some extra expertise.

    Ok then Cool ...Bye

     

  • Re: How to move databases between computers that are running SQL Server

    05-15-2009, 5:35 AM

     

    One can also use Copy database option to copy databases from source server to destination server. Otherwise the best way is to use ETL (Extract -Transform & Load) feature of SQL Server which is available by virtue of DTS in SQL Server 2000 or SSIS in SQL Server 2005. Here you can create Packages using BIDS (Business Intelligence Development Studio) IDE given by SQL Server 2005 and then run these packages by creating a job in SQL server.
  • Re: How to move databases between computers that are running SQL Server

    05-19-2009, 3:15 PM
    • Member
      190 point Member
    • ajitsatpathy
    • Member since 06-12-2008, 2:46 AM
    • New Delhi
    • Posts 61

     You can copy .mdf & .ldf file. But for that, you have to first stop the sql server service. And this is one of the bad idea, because noone will give permission to stop service in a live server where a number of applications are running. So you may follow one of the following solutions.

     

    1) You may generate query which will contains structure of all tables & all stored procedures, functions etc. (Data will not be copied in this process)

    2) Create back up & restore on your local machine where you want. (It'll copy strucure as well as data)

    3) Export data from one system & import data on another system by using DTS export wizard.

    Ajita Kumar Satpathy
Page 1 of 2 (20 items) 1 2 Next >