Showing posts with label SharePoint 2013 Upgrade. Show all posts
Showing posts with label SharePoint 2013 Upgrade. Show all posts

Tuesday, 5 September 2017

SharePoint 2013 ::: BCS Database is in compatibility range and upgrade is recommended

Hi all,

A few time ago, I went trought this message for the BCS Database on SharePoint 2013:

BCS Database is in compatibility range and upgrade is recommended


To solve this issue, I've executed this PowerShell commands:

This solved my particular issue.
If you have the same type of message for other databases, please proceed by the same way, by replacing the name of the DB by the known name when doing a Get-Member 


Add-PSSnapin Microsoft.SharePoint.PowerShell
Get-SPDatabase | FT -auto name,type
(Get-SPDatabase | ?{$_.type -eq "Microsoft.SharePoint.BusinessData.SharedService.BdcServiceDatabase"}).Provision()




Voilà,



That’s all Folks !!!

Sunday, 25 September 2016

SharePoint 2013 and Microsoft Security Patch side effects

Hi all,

Last week, I've patch with big success my production Farm (15 servers) and my Disaster recovery Farm (15 servers).

Little explanation about our configuration:

All the db (system, content, search, etc) are located on a SQL Cluster, set with several availability groups. (this point made me having white hairs during the previous Cumulative Updates).

On that Cluster, there is a primary group, where all the changes made in SharePoint (system, content, search, etc...) are committed (Read/Write).
Then, on the secondary group, all dbs are automatically sync from primary to secondary group (thus, in case of ay issue, I can easily have a fresh backup and replace the faulty db).

So, those 2 SQL cluster, are "dedicated" to my Primary Prod SharePoint Farm.

Beside this, I have a backup farm. She is identical to the primary farm, and was designed in case of disaster recovery, to replace the main Farm.

In the procedure, I've changed it to reduce the user impact to it's minimum.
The estimation is 2 time 5 minutes: DNS switch from Primary Farm to Secondary Farm, and Secondary Farm to Primary Farm.


So, to be short, both Farms were patched without issue.

The problem came 3 days later, when the mandatory security patch where applied on half of the servers in the company (Next half is done 2 days later).

I discovered that 1 server was back in "Upgrade required"... Oh, my words!!!!
Then, the day later, I had 5 other servers back in that status.

During that time, we had the support of Microsoft, and they recommend us to execute this powershell command:
     Get-SPProduct -local
     Reboot the server

Then, I did this procedure, and it works!!!!

After that, I've only execute the powershell command without rebooting the server, and my servers went back to "No Upgrade Required".

This powershell command must be executed on each server that have received a Microsoft security patch.


So, If your farm was successfully patched, and some server are back in the status "Upgrade Required", thus try this powershell command.
Your Farm and server are still up and running, and in take less than 5 minutes to correct the issue.




Voilà,


That’s all Folks !!!

Tuesday, 26 April 2016

SharePoint 2013 ::: Database is in Compatibility range and upgrade is recommended ::: Database is too old and upgrade is required

Hi all,

After the December 2014 CU, all my farms have their BDC Service Database in compatibility range.


I found the solution from Markus’ Blog and I’ve executed this PowerShell command:

Add-PSSnapin Microsoft.SharePoint.PowerShell
(Get-SPDatabase | ?{$_.type -eq "Microsoft.SharePoint.BusinessData.SharedService.BdcServiceDatabase"}).Provision()

Also, I got an error (as mentionned in his post), and checked the access rights.

This is the error I had:
PS C:\Windows\system32> (Get-SPDatabase | ?{$_.type -eq "Microsoft.SharePoint.BusinessData.SharedService.BdcServiceDatabase"}).Provision()
Exception calling "Provision" with "0" argument(s): "Cannot find the object "dbo.Versions" because it does not exist or you do not have permissions."
At line:1 char:1
+ (Get-SPDatabase | ?{$_.type -eq "Microsoft.SharePoint.BusinessData.SharedService ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : SqlException


So, I’ve asked to the SQL Team to add the SPDataAccess for the service account:

Then, I ran again the PowerShell command, and my BDCS database is now in “No action required” status.



I’ve also 3 system database that are in “Database is too old and upgrade is required” status.

For those 3 DBs, I’ve tried the same way as for the BDCS database:

First, getting the correct Type Name for each DB:
Get-SPDatabase | ft -Auto

Second, preparing the PowerShell commands:
(Get-SPDatabase | ?{$_.type -eq "Microsoft SharePoint Foundation Subscription Settings Database"}).Provision()
(Get-SPDatabase | ?{$_.type -eq "Microsoft.Office.Server.Administration.ProfileDatabase"}).Provision()
(Get-SPDatabase | ?{$_.type -eq "Microsoft.Office.Server.Administration.SocialDatabase"}).Provision()

Third, checking and adapting the SQL settings for SPDataAccess

Finally, executing my PowerShell commands.




Voilà,


That’s all Folks !!!

Wednesday, 26 August 2015

SharePoint 2013 returns to 'upgrade required' status

Hi all,

This post is related to the fact that after upgrading your SharePoint Farm with success, you are faced again with some servers in the "Upgrade Required" status.

As this issue was still coming and coming after each try to re-upgrade my farm, I decided to open a case at Microsoft support.

So, hereunder, you can find the resolution steps that will bring your smile back.


In summary, if one or several servers (my production farm is composed by 25 servers) are going back to the "Upgrade Required" after being marked as "No Action Required" during few days, check first if you don't have some sites that were not upgraded.
In this case, only 1 Site Collection wasn't correctly upgraded, and after a manual upgrade (via powershell cmdlets), all was solved.



Here is the case summary for your records:
==================
Title: SHP2013 returns to 'upgrade required' status
Severity: B
Status: Resolved and Closed

ACTION/RESULT:
Customer reported that after completing the upgrade to CU December 2014 (more than once) on the SharePoint 2013 farm - some the "Servers in this Farm" were still showing "Upgrade Required"

CAUSE/RESOLUTION:
In a previous upgrade attempt, there was the indication of a Site Collection that was not provisioned correctly:
07-24-2015 13:12:59.59 OWSTIMER (0x1CEC) 0x1F5C SharePoint Foundation Upgrade SPSiteWssSequence alsj5 WARNING SPWeb [https://mysite.sharepoint.me/sites/myname] [MyName, MyFirstName] is in a partially provisioned state. 021f1d9d-33b4-00ca-36cd-9ce05d7b2e40

Running (Get-SPSite https://mysite.sharepoint.me/sites/myname).NeedsUpgrade showed that this needs to be upgraded.
Customer ran the script:
$dir = Get-Location
$file = "$dir\farmSCUpgradeRequired.txt"

#Sites
Get-SPWebApplication -includecentraladministration | ForEach-Object {
               $webappurl = $_.Url
               $_.Sites | ForEach-Object {
                              "{0};{1};{2}" -f $webappurl, $_.URL, $_.NeedsUpgrade
               }
} | Out-File $file
This showed that the site collection mentioned before was in fact the only one needing an upgrade.

Customer run the powershell command:
  Upgrade-SPSite https://mysite.sharepoint.me/sites/myname -versionupgrade

The Site Collection was upgraded successfully.

After this, customer ran the "Product Version Job" timer job, and only 2 servers were still showing "Upgrade Required".
Running "stsadm -o localupgradestatus" showed only for these 2 servers, the following error message:
  <object>
    <name>Sharepoint_SA_UserProfile_Profile</name>
    <type>Microsoft.Office.Server.Administration.ProfileDatabase</type>
    <level>2</level>
    <status>Cannot Upgrade</status>
  </object>
  <object>
    <name>Sharepoint_SA_UserProfile_Social</name>
    <type>Microsoft.Office.Server.Administration.SocialDatabase</type>
    <level>2</level>
    <status>Cannot Upgrade</status>
  </object>

This means that the servers had something different than the rest of the servers, as the Databases were already up to date.
Running Get-SPDatabase | where {$_.Name -like "*UserProfile*"} | ft Name, NeedsUpgrade, NeedsUpgradeIncludeChildren, CanUpgrade also showed the information for these databases on the affected servers.

As this issue could only be on the servers, running the Configuration Wizard on both affected servers, made the message "Upgrade Required" go away.
After some days, the servers are still on a stable state.
=================



That's all folks

Thursday, 11 December 2014

SharePoint 2013 Upgrade Check List

Hi all,

Today, I’ve put all together my SharePoint 2013 upgrade experience.

As I have lot of Farms to admin, in different environments (Prod, pre-Prod, Test), I was faced to several issues.
So, in the ease for everyone, I’ve tried to figure out all the issues I had to solve.

This post is divided in 2 Sections:
1.       Pre-Upgrade CheckList: this is mandatory prior every upgrade
2.       Installation Process: binaries, and how I proceed the upgrade
3.       Trouble shooting: if something is wrong, the solution should/must be in this section


1.       SharePoint 2013 pre-Upgrade CheckList:
- Farm & Install accounts must be DB Owner on all system & content DBs
- Farm & Install accounts must have Security Admin  on all system & content DBs
- If there is mirroring, it must be stopped
- If there is Availability Groups, all DBs must be removed from the A.G
     *Update1: the USAGE database must not be part of an A.G nor mirroring
        This DB name is found in the "Manage servers in this farm" section in Central Admin
        The usage database name is like: <db_name>-USAGE
     *Update2: the "SPPLA-AppManagement" DB must also be removed from the A.G or mirroring
     
- Copy all needed binaries that must be applied (CU, PU, SP)


2.       Installation Process:
- Logon each server with your Install account
- Launch the binaries installation (exe file). This step can take up to 2,5 hours.
- Reboot all servers
- Check in Central Administration GUI that all servers status are: Upgrade required
- Launch, on each servers the Configuration Wizard, but one step at a time.
   --> launch Configuration Wizard, click "yes"
   --> do the same for each servers of the Farm
- Click "Next" on your Central Admin Server (always start by the Central Admin server).
- When upgrade is finish, DO NOT click to exit.
  Select the next server, and click "Next" in the Configuration Wizard.
  Do the same process to all your server until the last one.
- When all servers are upgraded, close the Configuration Wizard (Next or Finish) and check the server status in the Central Administration GUI:
  "No Action Required"


3.       Trouble Shooting:

What to do if the upgrade fails?
1- Check event viewer for any Farm or Install account access denied in SQL
2- Check ULS
3- Execute the installation via the PSCONFIG cmdlet.

/!\ ..... UPDATE .....  /!\

               PSConfig.exe -cmd upgrade -inplace b2b -wait -force

According to Stefan Goßner, in SharePoint 2013, it is the best paractice to use the PSCONFIGUI.exe instead of PSCONFIG.exe
The reason is because the GUI version is doing more complete upgrade.

For any reason, if you need to use the PSCONFIG.exe, then use this cmdlet:
PSConfig.exe -cmd upgrade -inplace b2b -wait -cmd applicationcontent -install -cmd installfeatures -cmd secureresources

/!\ ..... UPDATE .....  /!\


What to do if the Configuration Wizard is showing "Missing on <servername>"?
In the configuration Wizard, if there is some installed patches shown as "Missing on <servername>" (and they are already installed), you can use this PowerShell command :
Get-SPProduct -local
Then, press "Refresh" in the Configuration Wizard".
When the servers are no more in the list, you continue the patching process.

What to do if in the error logs (i.e : Upgrade-20141027-143441-40-error) you have this type of message?
Upgrade SPUpgradeSiteSession           ajxnj        ERROR
                at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
                at System.Net.HttpWebRequest.GetRequestStream()
                at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()

                ==> check that all Application Pools are up and running in IIS on all servers

What to do if you have Site Collection upgrade issue?
If you have this type of line in the error log:
ERROR   Pre-Upgrade [SPSite Url=<Your Site Collection URL/...] failed. Microsoft.SharePoint.Upgrade.SPSiteWssSequence has the ContinueOnFailiure bit set.
                ==> upgrade manually yours sites:
                Get-SPSite -Limit all | Where-Object {$_.NeedsUpgrade} | Upgrade-SPSite -VersionUpgrade -Unthrottled


*Update:
If you have this error with the previous cmdlet:

PS C:\Windows\system32> Get-SPSite -Limit all | Where-Object {$_.NeedsUpgrade} | Upgrade-SPSite -VersionUpgrade -Unthrottled
Get-SPSite : There was no endpoint listening at http://localhost:32843/SecurityTokenServiceApplication/securitytoken.s
vc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if 
present, for more details.
At line:1 char:1
+ Get-SPSite -Limit all | Where-Object {$_.NeedsUpgrade} | Upgrade-SPSite -Version ...
+ ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (Microsoft.Share...SPCmdletGetSite:SPCmdletGetSite) [Get-SPSite], Endpoint 
   NotFoundException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletGetSite

Check that those Services are running:
  - SPAdminV4
  - SPTimerV4
  - W3SVC

Reason:
 This is due to a faulty PSCONFIG.exe cmdlet.
 If the upgrade is not successfull, then the services are not started back.



That’s all folks