Copy A SQL Server DB To An External HD - Server Fault
Copy A SQL Server DB To An External HD - Server Fault
Please upgrade to Microsoft Edge, Google Chrome, or Firefox. Learn more about our browser
support.
Stack Exchange network consists of 178 Q&A communities including Stack Overflow, the largest,
most trusted online community for developers to learn, share their knowledge, and build their
careers.
1.
2. 0
3. +0
4.
◦ Tour Start here for a quick overview of the site
◦ Help Center Detailed answers to any questions you might have
◦ Meta Discuss the workings and policies of this site
◦ About Us Learn more about Stack Overflow the company
◦ Business Learn more about hiring developers or posting ads with us
5.
6. Log in Sign up
7. current community
◦
Server Fault
help chat
◦
Meta Server Fault
your communities
company blog
Server Fault is a question and answer site for system and network administrators. It only takes a
minute to sign up.
Sign up to join this community
Server Fault
1.
Home
2.
1. Public
2. Questions
3.
Tags
4.
Users
5.
Unanswered
6. Find a Job
7.
Jobs
8.
Companies
3. Teams
Stack Overflow for Teams – Collaborate and share knowledge with a private group.
2.
Teams
Connect and share knowledge within a single location that is structured and easy to search.
Learn more
Copy a SQL Server DB to an external HD
Ask Question
Asked 10 years, 8 months ago
Active 10 years, 8 months ago
Viewed 6k times
This question does not show any research effort; it is unclear or not useful
1
Bookmark this question.
I found a lot of similar questions in the archives, but none quite answered this.
I need to copy a database from one server (SQL Server 2008) to another. Each server is in its own
system, and no computer can connect to both servers.
My original plan was to backup the database, copy it to an external hard drive, move it to the new
server, and restore. Unfortunately, the server with the database is entirely out of storage,
preventing me from making the backup file. Is there a way to backup a database from a remote
server directly onto an external hard drive, or onto the local computer? When I use the backup
wizard, it only shows me local paths.
sql-server copy
Share
Improve this question
Follow
Follow this question to receive notifications
asked Jun 8, 2011 at 12:14
GeoffGeoff
2111 silver badge22 bronze badges
2
• Thanks for the responses. I wasn't logged in when I posted my original post. Too early for
me too, I guess. But I am the original poster. I am attempting to back up to a local path, as
discussed, but I'm not sure if I have the path name right. I have tried the following:
\\localhost\e$\data\backup.bak \\127.0.0.1\e$\data\backup.bak And neither
works. I know this is a basic question, but how do I find my external drive's UNC? Thanks
again!
– registrar
Jun 8, 2011 at 15:35
• @Peter - I'm not sure that's the problem. The database is hosted on a remote server, and the
hard drive is mapped on my local computer. My problem is that I don't know how to
specifiy a local address for the backup, and the hard drive is local. If the hard drive were
attached to the server, I don't think it would be a problem. My current approach is as
follows: right click on the database > Tasks > Back Up...; under "destination," I click
"add..." and type in: \\localhost\c$\backup.bak And it throws the following error:
"cannot verify the existance of the backup file location" Thanks again f
– registrar
Jun 8, 2011 at 16:51
Add a comment |
4 Answers
Active Oldest Score
You can detach the database, copy the data (.mdf) and log (.ldf) files to external storage, then
reattach those files on the new server. When you detach a database, SQL Server closes the data
and log files and the database is removed from the server. You can then work with the files safely.
If you want to retain the database on the original server you just reattach the database.
For instructions on how to do this via SQL Server Managment Studio see this article.
Share
Improve this answer
Follow
Follow this answer to receive notifications
answered Jun 8, 2011 at 12:16
squillmansquillman
37.4k1010 gold badges8888 silver badges144144 bronze badges
Add a comment |
You cartainly can backup a database to a UNC path. When you're selecting the backup destination
(when you select the disk option in the backup) simply type the UNC path that you want to backup
to, including the filename, such as:
\\server\share\database.bak
Share
Improve this answer
Follow
Follow this answer to receive notifications
answered Jun 8, 2011 at 12:27
joeqwertyjoeqwerty
107k66 gold badges7979 silver badges166166 bronze badges
4
• I assumed this would not be an option since OP states that no computer can connect to both
servers.
– squillman
Jun 8, 2011 at 12:31
• True, but the target for the backup doesn't have to be the destination server for the database.
The OP can backup the database to a UNC path that's local to the source server, then simply
copy the backup from the backup target machine to an external hard drive and transport it to
the destination server. I assumed that the OP meant that no computer can establish a
connection to both computers simultaneously (different networks) but that he has at least
one computer at each location that can communicate with the relevant server. I could be
misunderstanding things.
– joeqwerty
Jun 8, 2011 at 12:36
• Yes, of course... [back for more coffee] :)
– squillman
Jun 8, 2011 at 13:02
• Me too... too early...
– joeqwerty
Jun 8, 2011 at 13:34
Add a comment |
On your local machine, (The "admin" box that has the external hd plugged in) share a folder on
the external hd with "everyone", full rights.
Once you can browse that unc from your rdp session on the remote db server, you'll be able to
back up to it using sql studio.
Share
Improve this answer
Follow
Follow this answer to receive notifications
answered Jun 8, 2011 at 17:01
BobBob
59722 silver badges88 bronze badges
1
Add a comment |
If you can RDP onto the server, then you can obviously find out the details from Windows
Explorer.
If you can't, execute xp_fixeddrives in Query Analyser - and hopefully, the USB drive with the
available disc space will stick out like a sore thumb. You should then be able to backup to it like a
regular drive.
Share
Improve this answer
Follow
Follow this answer to receive notifications
answered Jun 8, 2011 at 16:31
Add a comment |
Your Answer
• Please be sure to answer the question. Provide details and share your research!
But avoid …
Sign up or log in
Name
By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie
policy
Related
5
How do I copy a SQL Server 2005 Database?
7
T-SQL Script to copy a database
0
sql server backup
2
Difficulty restoring a differential backup in SQL Server, 2 media families are expected or no files
are ready for rollforward
1
How can I restore a SQL Server database file from a shadow copy?
0
Tools to manage sql 2008 database mirroring?
3
Restoring SQL Server backup to SQL Azure on SQL Management Studio
2
backing up sql server logs to external USB drive
2
how to copy sql server database on same server
0
Transferring MS SQL database to other server - Best Practice
Hot Network Questions
•
Represented by three stripes
•
How to Make a Double Sided Funnel
•
Replacing '.' and '-' in a column values with empty space ''
•
Is there any famous protocol that were proven secure but whose proof was wrong and lead
to real world attacks?
•
Did a Turkish cargo ship get bombed in the Black Sea during the Russian invasion of
Ukraine?
•
Is CIDR IP format currently in use?
•
something went wrong when using `\declaretheoremstyle` and `\declaretheorem` in LaTeX3
•
How does the second stage rockets ignite their engines?
•
Is it reasonable to request to temporarily keep a laptop after a postdoc contract has finished?
•
How would humans mutate in an urban enviroment?
•
How do I 'OR' a digital signal?
•
Guessing game - Too high. Too low
•
Microsoft SQL server storage best practice on Windows server vm with hybrid storage
•
What were the actual memory model definitions in MS-DOS?
•
Is encryption in transit distinct from end-to-end encryption?
•
Generate a Multicolor Figure Eight with Numbered Circles and Text
•
How to draw a ellipse sector from focus
•
Credit card numbers on the back - is it not less secure?
•
Who "dribbled a lot and wasn’t allowed anything sharp" in "Good Omens"?
•
What is the fastest algorithm to approximate an irrational number with specified precision?
•
How to remove string from matrix elements?
•
Why do Americans use fuses and not differentials and breakers like Europeans do?
•
Why is Homebrew installed in /opt/homebrew on Apple Silicon Macs?
•
What precisely are brute contingent facts?
more hot questions
Question feed
Subscribe to RSS
Question feed
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
https://serverfault.com/feeds/question/278229
Server Fault
• Tour
• Help
• Chat
• Contact
• Feedback
• Mobile
Company
• Stack Overflow
• For Teams
• Advertise With Us
• Hire a Developer
• Developer Jobs
• About
• Press
• Legal
• Privacy Policy
• Terms of Service
• Cookie Settings
• Cookie Policy
• Technology
• Culture & recreation
• Life & arts
• Science
• Professional
• Business
• API
• Data
• Blog
• Facebook
• Twitter
• LinkedIn
• Instagram
site design / logo © 2022 Stack Exchange Inc; user contributions licensed under cc by-sa.
rev 2022.2.25.41536
Your privacy
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and
disclose information in accordance with our Cookie Policy.