For restoring database follow this-
When restoring, select your backup file. Next, click 'Options' in the left pane (SQL Server 2005's management studio).
In the right side, you will now see 'Restore options' (Check
"Overwrite the existing database") and "Restore the database as:". The
latter is the important part.
There are two columns in the "Restore the database as:" section. The
left side is the original name of the files, and the right side is what
you want to change the names of the files to.
Changing the name of the backup file does NOT change the name of the original .mdf and .ldf files.
In the right column, scroll all the way to the right to see the file
name, and change it to your new preferred name: Josie.mdf for the
primary file and Josie.ldf for the log file.
The actual names you give to the files do not have to have anything
to do with the database name, but should so that you can easily
reference them if backing up or physically moving/copying files.