Recently I had tried deleting a site collection and tried
restoring the site with the same URL and I got the below error
Restore-SPSite https://sitecollectionurl -Path
"E:\filename.bak" -Force
“ Restore-SpSite : The operation that you are
attempting to perform cannot be completed successfully. No content databases in
the web application were available to store your site collection. The existing
content databases may have reached the maximum number of site collections, or
be set to read-only, or be offline, or may already contain a copy of this site
collection. Create another content database for the Web application and then
try the operation again “
How
to fix this
Restore-SPSite https://sitecollectionurl -Path
"E:\filename.bak" -Force –DatabaseServer "DBServerName" -DatabaseName
"DBName"
And it worked this time. Site was successfully restored.
This happened because I was trying to restore or create a
new site with the same url that was deleted some time back. There is a chance
it has not been removed from the database permanently
Alternatively, to delete the old site, do the below steps
Get-SPDeletedSite
If the site exist with the same URL remove using
Remove-SPDeletedSite -Identity