Spring is almost here. Soon the happy sounds of birds chirping, lawnmowers mowing and my neighbor yelling “Get off my lawn!” will fill the air.

Spring cleaning is a time-honored tradition in these parts, and in this article, I’ll talk about how spring is not only a good time to hang those rugs out on the line, but also a good time to go over your SharePoint farm and make sure it’s in good shape. In this article, I’ll give SharePoint administrators some ideas on where to look for cobwebs in your SharePoint farm, and how to clean them out.

The wheat and the chaff
SharePoint is often a victim of its own success. It is so easy for end users to get documents into SharePoint and create all kinds of glorious sites. Unfortunately, that means it’s also easy for users to upload a bunch of garbage into SharePoint, then never touch it again. That’s garbage that you have to store and back up. Who wants to back up garbage?

Unfortunately, once your farm gets large, it’s tough to get a handle on which site collections are being used and which ones aren’t. You could plow through your IIS logs, or use some Web analytics software to determine which site collections are used, but that’s a lot of work. To get you started in your hunt for the unused site collections in your farm, you can use this little bit of PowerShell:

get-spsite -limit all | Where-Object { $_.LastContentModifiedDate -gt (get-date).AddDays(-90) } | select url, LastContentModifiedDate

That PowerShell command will report back all the site collections in your farm that have not had content added to them in the last 90 days. You can change the number in the “AddDays” block to however many days you would like. This doesn’t mean nobody has read from them though. Don’t just delete them out of hand. This will give you a short list of sites to check and make sure they’re needed. Contact each site collection’s owner to see what the story is. If they are just being used for read-only, maybe they can be moved into a separate database for less-used sites and backed up less frequently. Knowing which site collections are being used and which ones aren’t is good information to have.
Slimming down
While you’re looking at your site collections, it’s also a good time to look at your databases as well. Over time, those little buggers can sneak up on you and grow to enormous sizes, like the dust bunnies under the refrigerator. This is another casualty of SharePoint just being so gosh-darned easy to use.

If your site collections don’t have quotas, they can grow with reckless abandon. While we’re doing our spring cleaning, let’s make sure none of our databases are “too big.” Now, “too big” can be tough to define, and it isn’t the same for every environment. For non-content databases, there really isn’t a lot to keep track of. Give the MDF and LDF files a look to make sure they aren’t filling any drives. For content databases, databases that are “too big” generally are databases that are too large (up to 200GB) to back up and restore in a timely fashion. In most environments though, you should keep your content databases below 100GB for easier manageability.

This Microsoft white paper outlines some guidance on databases, and includes some links on how to handle their size if you have a large farm. If your content databases are edging toward being too large, you can use this technique to move some site collections from the large content database to a new, smaller one. That’ll help keep your database sizes under control, and will also make doing restores less time consuming.

Back from the dead
Speaking of backups, now is a great time to verify your backups are working, and more importantly, that you can restore from them. Backing up your databases or your farm isn’t enough; you need to actually be able to restore from those backups in the unlikely event of a data loss.

Springtime is a great time to test your recovery techniques, whatever your backup strategy is. If you do database backups, try restoring them to your test farm. If you have farm-level backups, try restoring parts of it to your test farm. (If you don’t have a test farm, well, shame on you!) Hopefully it will be a very quick, boring exercise.

More likely, though, you’ll find that restoring isn’t quite as clear-cut as the disaster-recovery document your boss made you write may make it seem. It’s better to figure this out now than when the world’s most important site collection is deleted just moments before the world’s most important meeting with the world’s most important people. What? It could happen. It happened to me twice at my last job.

Extra credit
If you want your SharePoint house to be extra spic-and-span, you can go over to my most recent article, “Top 10 SharePoint 2010 Configuration Mistakes—and How to Fix Them,” and see how many your farm has. Feel free to compare your scores with your friends.

Springtime is a wonderful time. The flowers are blooming, the birds are singing, and the neighbor’s dog is leaving gifts in my front yard. Now is a great time to give your beloved SharePoint farm a quick once-over and make sure it’s in better shape than that Jared guy at Subway.

Todd Klindt is a senior SharePoint consultant at SharePoint911 (a Rackspace company), has written several books on SharePoint, and maintains a blog at www.toddklindt.com.