Wednesday, March 25, 2009

The Revenge of SharePoint

Remember my SharePoint article from 2 months ago ? Well, believe it or not, but I have crashed my SharePoint site beyond my repair skills capabilities. It happened after a domain migration and was due to some dark account permission problem on the SQL 2005 database.

After having wasted a few hours on the problem, I decided to re-install it from scratch on a new and better set up virtual machine. After all, it was only a prototype without too much production data in it.

The first thing I did was using my previous SharePoint installation article as guideline and i will say it was definitively worth writing it and I got my payback for it. While I was at it, I also wanted to bring in a couple of improvement to my initial setup.

As SQL Server 2005 was installed on the C:\ drive, I needed to move the SharePoint databases to the D:\ drive which was designed to contain the data. I proceeded as follow after having installed Sharepoint Services:

In order to move a Microsoft SQL Server 2005 SharePoint database, I needed to:
- Stop the IIS SharePoint site.
- Stop all Windows SharePoint Services: Administration, Timer & Tracing.
- Backup the SharePoint content and configuration database.
- Detach these databases using SQL Server Management Studio.
- Move the database files (.ldf & .mdf) to the new location.
- Attach these files back to SQL Server 2005 still using the SQL Server Management Studio.
- Restart the SQL server.
- Restart all SharePoint services.
- Restart the iis SharePoint site.
And it worked like a charm.

I decided to add some better web parts to the portal and as such downloaded and installed What's New, Chart, AutoComplete, and Copy Paste web parts from the SmartTools suite on CodePlex. The What's New web part is probably the best of them. All these parts are ridiculously easy to install and deploy.

I also wanted to change my security strategy and to really use two Web Applications: one for the Central Administration on some exotoc port and the SharePoint content sites on port 80. As I had already recreated my content sites under the Central Administration, I needed to move them all to a different application in order to better manage their security. Therefore I had to first move the Central Administration from port 80 to another port (see my article for instructions), then create a new web application on port 80, export all created sites and re-import them into the newly created Web Application on port 80. The export/import operation was made simple thanks to the stsadm command line tool. Afterwards I simply had to uninstall and re-install the CodePlex SmartTools to have them active under the new Web Application.

And that's it, my SharePoint site is now back and ready to be used.

No comments: