I have got a .bak file (database backup) of a SharePoint environment. However when I restore this file in the database and add this db as a content database I get "0" site collections. What am I doing wrong in this? am I using this the wrong way?
Before adding it to the server, launch the Test-SPContentDatabase script on the restored content db.
If you got errors, then check your restored db and try to fix the errors, or sometimes, it might be just a corrupted backup, try to backup it again.
If everything is ok (just got warnings), then launch the Mount-SPContentDatabase to mount your content db with a web application. It should go fine.
the SharePoint farm service account must be a member of the SQL Server dbcreator fixed server role. To attach a content database to a Web application, the SharePoint farm service account must have db_owner permission for the content database.
Ref : For more information