INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

How would you move SQL Server data from old PC to New PC

How would you move SQL Server data from old PC to New PC

(OP)
I am getting a new PC at work. Currently I am using SQL Server 2008 Express R2 on my desktop and am
getting a new PC at work. Once I get SQL Server installed on the new PC, how do I get the data to the new
PC. Thanks

RE: How would you move SQL Server data from old PC to New PC

Frederico's way is probably the best. You can also backup and restore.

djj
The Lord is my shepherd (Psalm 23) - I need someone to lead me!

RE: How would you move SQL Server data from old PC to New PC

Backup and restore will be the best way for big files (40GB or more) - but if you go with backup option make sure you make the backup to 4 backup files not just one as it will perform a lot better both on backup and restore.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
www.syssoft-int.com

FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

RE: How would you move SQL Server data from old PC to New PC

(OP)
Thanks for responding. The files are not too large. I am unsure of the file extensions to look for. Once i determine them, I can copy to my home drive for temporary keeping, then copy them to the C: drive on the new laptop...then I would attach. Does that sound correct.

RE: How would you move SQL Server data from old PC to New PC

That is correct.

You can see what is the name of the physical files by issuing the following sql statement.

SELECT name, physical_name AS CurrentLocation
FROM sys.master_files
WHERE database_id = DB_ID(N'<database_name>'); replacing database_name by your required databases

Regards

Frederico Fonseca
SysSoft Integrated Ltd
www.syssoft-int.com

FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

RE: How would you move SQL Server data from old PC to New PC

If you have defined anything like logins (to share data with other people), or linked servers (to get data from other SQL Servers), you will have to see about getting those scripted out. Fortunately, they are not too hard to get with SQL Server management studio.

RE: How would you move SQL Server data from old PC to New PC

(OP)
I don't want to mess this up. I have copied the .MDF and .log files to my home drive.
I did not see an attach command in the database when I right-clicked so let me go over the steps again....

1. Detach the databases from laptop 1 (there are 5)
2. Navigate to the SQL Server \DATA folder and copy the .MDF and the .LOG files to my H: drive
Do this for each of the 5 databases.......

3. Copy the .MDF and .LOG files to the SQL Server \DATA folder on laptop 2
4. Attach the database
Do this for each of the 5 databases

Thanks for bearing with me....

RE: How would you move SQL Server data from old PC to New PC

can you please post the output of the sql I gave you before. making sure you replace the database name with your correct one for each db. this is only so we can confirm which files you need to move.

to attach a db, you right-click on the database note on SSMS and select the "attach" option.. that will popup a window wich you can then go and select the mdf file and let it work from there.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
www.syssoft-int.com

FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

RE: How would you move SQL Server data from old PC to New PC

(OP)
Got it to work. Thanks

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close