If you are performing an upgrade with a database connection, you can install read-only databases through SQL Management Studio. When SharePoint databases are installed in read-only mode, SharePoint will automatically protect all sites in these databases for viewing only.
source share