I always like to take the cautious approach to administration.
Before making any changes to the environment, I would suggest your friend take database backups of all relevant databases at source.
Then, rather than using attach/detach. Restore the database to the new instance.
Try this:
CREATE DATABASE foo;
GO
CREATE DATABASE bar;
GO
BACKUP DATABASE foo TO DISK = 'c:\temp\x.bak';
BACKUP DATABASE bar TO DISK = 'c:\temp\x.bak';
GO
RESTORE HEADERONLY FROM DISK = 'c:\temp\x.bak';
Relevant columns for this scenario:
Position DatabaseName
-------- ------------
1 foo
2 bar
To restore foo
, whether it exists or not:
RESTORE DATABASE foo FROM DISK = 'c:\temp\x.bak'
WITH FILE = 1, REPLACE;
To restore bar
, whether it exists or not:
RESTORE DATABASE bar FROM DISK = 'c:\temp\x.bak'
WITH FILE = 2, REPLACE;
If you don't specify WITH FILE
, you will get a slew of errors, depending on whether the database in Position = 1
already exists.
The lessons here:
- do not use common and generic names for backup files - name them for the database they represent and keep them separate.
- use
WITH INIT
if you expect a backup file to only ever contain one copy of a backup.
- understand what is in your backup by first running
RESTORE
HEADERONLY
and/or RESTORE FILELISTONLY
.
If you show us those two columns from the output of RESTORE HEADERONLY
and what database you are actually trying to restore, we can provide you with a specific command that should work.
Best Answer
Yes, you can, as long as the database is < 10 GB and doesn't use any features not supported by Express (you didn't mention what edition was being used in 2008 R2).
Stop using the broken point-and-click UI, and instead use a proper
RESTORE DATABASE
command:If you get errors from that (after replacing all of the obvious bits that are specific to your database and system), post those.