Restoring a database from a backup file
A restore rebuilds a database from a backup file. It is how you move data between machines and how you recover from a mistake.
The command
SQL
RESTORE DATABASE ShopPractice
FROM DISK = 'C:\backups\Shop.bak'
WITH MOVE 'Shop' TO 'C:\data\ShopPractice.mdf',
MOVE 'Shop_log' TO 'C:\data\ShopPractice_log.ldf';Why the move clauses are there
A backup remembers where its files used to live. If you restore on a machine without that exact folder, the restore fails. The move clauses tell it where to put the files on this machine, and they let you rename the database at the same time.
Restore to a new name. Restoring under a new name lets you compare the backup with your current data without overwriting anything. It is the safest way to look before you leap.
Once restored, point a project at it using the connection string from making the database reachable from your site.