A Practical Guide to SharePoint 2013

A Practical Guide to SharePoint 2013
A Practical Guide to SharePoint 2013 - Book by Saifullah Shafiq
Showing posts with label Database. Show all posts
Showing posts with label Database. Show all posts

Monday, March 20, 2017

SharePoint Integration with IIS



Before discussing the Integration, we will discuss the architecture of SharePoint at the architecture level. The diagram represents the architecture of SharePoint and split into two halves. The Left-half is administrator world and the right-half is the end-user world. Everything in right half resides in SharePoint content database. Let's continue with some terminologies before goes into deep dive. 

Farm

A farm is a logical architecture or logical grouping of SharePoint servers that share common resources of SharePoint. It can be a single machine or more than one machine. The farm is differentiated on their tier levels. Might be possible Farm can be 1to N-tier. Installation can either be done at 1 machine to N. Most of the cases in production you have to choose at least 5-tier architecture for application Server, front-end Server, SQL, AD+DNS, Office Web App Server and Exchange; you can add more than one application server, Front-End etc at any level.

Configuration Database

Each farm is associated with a SQL server database called a configuration database. The SharePoint CONFIG database as SharePoint_Config created during SharePoint Products Configuration Wizard and is used by the central administration to manage all of your web applications, site collections, and service applications etc. Configuration Database co-located with the Central Administration database. Generally, you only have one instance of SQL server per farm, unless you cluster or mirror the instance. A SharePoint farm can only have one central administration database although you can host the central administration website on more than one server on your farm.


Site collection and Site

A site collection is a logical grouping of sites and a site is a container for information. In a site, we can have lists and libraries. A site collection is made up of one top-level site and all sites below it. The number of site collections you can have in a single web application depends on the capacity of your server infrastructure. 
For more information here is the link of Technet.


List and Library

A list is like an Excel worksheet just like rows and columns of data. A document library is just a special case of a list. We still have rows and columns of data, but each row is associated with a document. So we can store pictures, text files, web pages and all kind of documents. In-library others column except document filed called metadata of that library. A list has major versions only, can have attachments but not indexed, do not have Check-in/Check-out features and didn't open with explorer but in cased of library, files are directly in the library can't have attachments, have both minor (draft) and major (published) versioning, have Check-in/Check-Out, publishing libraries can use Page Layouts and Have Unique Document Ids out of the box.


SharePoint content database

Everything on the end user part (right-hand side) in the architectural diagram is stored in SharePoint content database. So, if we create a site within a site collection, we are adding an entry to a table in the database. If we create a list, again, we are adding entries into tables. If we add a document to a document library, that will also add an entry in the database.


Deployment mechanism of web application

A web application is just an extended IIS website, so when we create a web application, SharePoint creates an IIS website but modifies the WEB.CONFIG file, GLOBAL.ASPX file and creates some virtual directories which point to the SharePoint system folders.


Integration with IIS

SharePoint integrates with both IIS and ASP.NET, IIS websites are extended through the standard extension mechanisms built into ASP.NET. In SharePoint, integration with IIS is done at web application level. The files used by IIS are stored in \INETPUB\WWWROOT\WSS\VIRTUALDIRECTORIES\<PORT> and this port is used by the IIS website and the SharePoint web application.
The WSS part of the path refers to the “Window SharePoint services”. The folder of the web application at port 80 just has a GLOBAL.ASAX and WEB.CONFIG file. The default installation or the basic installation of SharePoint takes over port 80.


ASP.net and SharePoint Development

The default installation or the basic installation of SharePoint takes over port 80. So if you want to do SharePoint development as well as ASP.NET development then you will need to have a separate IIS website where you can host your ASP.NET applications. They will host their externally to SharePoint inside IIS.

SharePoint Central Administration Utility


When you create new web applications or when you are managing web applications you've to use the SharePoint Central Administration Utility (browser based) or STS Admin (classic way) or PowerShell commands instead of IIS Manager. Now there are certain cases where you do need to get into the IIS Manager like IISRESET etc.

The default installation path for SharePoint files used by IIS is C:\inetpub\wwwroot\wss\VirtualDirectories\80.




"12625" is the name of the port assigned to central admin web application. We can change the port of the newly created web application but it will not change the folder name. So, the name of the folder will remain unchanged. If we want to change the name of the folder too, then we will need to update is manual.

We can see in the screenshot that upon changing ports to the "9999", it changed the ports on IIS panel and in SharePoint but it did not change the folder name. SharePoint files are present in the SP system folders and SP databases.


The below screenshot is showing the website of central admin.

We can see the comparison of both folders. The 80-port directory contains files, GLOBAL.ASPX and WEB.CONFIG and we can also store the backups files of web config.

Screenshot presents the mapping between the web application and IIS manager. 

Now create a new web application using SP central administration, click “New”, remove GUID from DB Name, specify the port number and click OK. After that a create the site collection. The web application is now added to SharePoint central administration. In Application Pools inside the IIS Manager new application pool would be created and virtual directories in contents tab.

Authors [Ali Mamoon, Mujahid Hafeez]

Monday, September 26, 2011

After SharePoint 2010 database attach upgrade alerts have the wrong URLs (Via shane)

Extracted

“ Database attach upgrades seem to be the norm these days for customers upgrade from SharePoint 2007 to SharePoint 2010. I am assuming the reason for this is because they are very flexible and generally work pretty well. One of the flexible things about these type of upgrades is you can change your web application URL. Some customers are going from short URL to fully qualified (FQDN) like http://portal tohttp://portal.company.com. And some of our customers are making complete changes going from http://sharepoint.company.com tohttp://intranet.company.com. The nice thing about making these types of changes is for the most part a content database has no concept of the web application URL. If you go hunting through the database (which you should never do) you will see everything is relative. The site collections know their urls as / or /sites/sitecollection. That way changing the URL doesn't matter.

But then there are alerts. Alerts are hard coded to the web application URL that was used to create the alert. This is why if you have multiple URLs for you SharePoint site your alerts may be inconsistent. If your portal is setup so you can access it as http://portal orhttp://portal.contoso.com then whichever of those URLs you are browsing the site with when you click create alert will be the URL SharePoint sends out in the alerts. Kind of annoying for some people but it is what it is. The real problem comes if you switch URLs.

For complete article, click here.


Thursday, August 28, 2008

Comparing two different date formats

If one date control is using a format different than the other date control, how will you compare the dates? Why will this happen? Why will the two dates be using different formats in the same form? well, you can't argue with the client. can you? This was a real scenario that I faced some time ago. So, convert the dates to one format and compare them. For example,
   string shortDate1 = Microsoft.VisualBasic.Strings.FormatDateTime(Convert.ToDateTime(Date1), Microsoft.VisualBasic.DateFormat.ShortDate);
   string shortDate2 = Microsoft.VisualBasic.Strings.FormatDateTime(Convert.ToDateTime(Date2), Microsoft.VisualBasic.DateFormat.ShortDate);
   if (DateTime.Parse(shortDate1) < DateTime.Parse(shortDate2))
   {
         //Display message
   }
In the code above, I am comparing two dates, Date1 and Date2. These dates are stored in string format in the form. So we convert them to date format first and then to short date format and then compare them.

Monday, December 24, 2007

KB934525: Database issue!

KB934525 is required to fix a vunerability in Sharepoint. Read security bulletin for more information.
Information about KB934525 can be read at http://support.microsoft.com/kb/934525
Many people have reported that their SharePoint broke after installing this security update. This can happen if the security update fails to install properly. People have reported different issues and errors. One of the common errors if this update fails is:
'SharePoint_AdminContent_GUID' on SQL Server instance 'XXXXXXMicrosoft##SSEE' is not empty and does not match current database schema.

Another error is:
The specified SPContentDatabase Name=SharePoint_AdminContent_GUID Parent=SPDatabaseServiceInstance Name=Microsoft##SSEE has been upgraded to a newer version of SharePoint. Please upgrade this SharePoint application server before attempting to access this object.
How can you fix these errors?
First, restart the SPWebService. You can do it manually from the "Services" mmc. You can also run the stsadm command to restart this service.
Then, run the following command:
PSCONFIG -cmd upgrade -inplace b2b -wait -force
You must perform b2b (build to build) upgrade.
Hopefully this will fix your database problem.