Mind the Site Locks when Move-SPSite Fails

Recently I was working on a migration of a couple of big sites moving them to their own content databases and it didn’t exactly turn out as I planned.

So more than anything, I wanted to use this post to describe what happened and mention some tips and other things that may help others out in the future if you ever run into trouble when trying to break out sites into their own databases.

Here are the major events that happened in the migration process:

  1. Created DB under central admin
  2. Used Move-SPSite to move one site from another content database
  3. Content stuck on Move-SPSite, never finished
  4. Restarted all servers
  5. When came back up, new destination database was in recovery
  6. Recovery process used all SQL resources, major slow down of farm (sad time)
  7. Looked into SQL logs to check status of recovery thinking new destination database would come back up
  8. Actually after recovery finished, I still had no access to content created in new content database
  9. Checked and under central admin checked site locks and quotas
  10. Turns out entire site still on old source DB
  11. Hadn’t been copied over, even though SQL showed a populated database
  12. Site lock had been switched on all the way to no access
  13. Users going to site would get a 403 forbidden message when trying to access
  14. Went under site locks and cleared the lock
  15. Once this was done, content access returned to normal
  16. Original content and under Central admin still said content was on source DB
  17. New destination content DB under still showed also that it contained no content

So in the end, the big lesson learned here was that even though I could check SQL and see that the new DB contained information, SharePoint hadn’t moved the site over to the new content database.

I did some research and there are timer jobs that run gradual site deletions, but I don’t think they applied here. Either that or I switched back to the original database before anything else was allowed to happen.

In the future, I may just use Backup-SPSiteĀ  along with Restore-SPSite because that command also has the ability to specify a new database to put the site into when the backup is restored.

I hope these tips save you some time and headaches in the future.

Enjoy!

Advertisements