We came across a scenario where we needed to move SQL Express 2008 Database from one computer to another computer. Posting the steps for the same , hope it helps your requirement at some stage!!
A. Go to SQL Server. Open SQL Server Management Studio.
B. Click on New Query and execute the below command.
Backup Database YourDatabaseName TO Disk=’D:\yourbackupfilename.bak’
C. Copy the backup file to target machine
D. On target machine open SQL Server Management Studio.
E. Click on New Query and execute the below command.
RESTORE FILELISTONLY FROM DISK=’D:\yourbackupfilename.bak’
This will give the Logical Data and Log File Name to be used for restore command.
F. Click on New Query and execute the below command.
RESTORE DATABASE Merckcontacttesting
WITH MOVE’YourLogicalDatafileName’ TO ‘D:\ yourdatabase.mdf’,
MOVE ‘YourLogicalLogFilename’ TO’D:\yourdatabase_log.ldf’
Then Refresh the database as shown below and you will see your new database created.
Also see the databse mdf and ldf file created at the specified location
Exit the SQL Management Studio without saving the Query. And use the database moved as required.