Tuesday, September 30, 2014

Project Server 2013 migration between environments.

Project Server Migration required 2 databases ( PWA database + web application DB)




Step 1 :  Dismounting Project web instance.


Dismount-SPProjectWebInstance -SiteCollection  <URL of Test / Dev PWA site that you want to refresh with the Production data and config>




image




Step2 :


 Dismount-SPContentDatabase “<Database name here>”




Step3 : Mounting Production Content DB 


Mount-SPContentDatabase “<content database name restored in previous step>” -DatabaseServer “<Test / DEV SQL Server>” –WebApplication <web application URL>




Step4 :  Mounting Project Database




Mount-SPProjectDatabase -Name “Name of the restored Project Web App database to mount” –WebApplication “Web Application ULR that the Project Web App database will mount to” –DatabaseServer “Test / Dev SQL Server where the database was restored




Step5  : Mounting Project database to web instance.


Mount-SPProjectWebInstance –DatabaseName “Name of the restored Project Web App database to mount” –SiteCollection “web application URL + PWA path” –DatabaseServer “Test / Dev SQL Server where the database was restored




NOTE : For example if the instance is called /PWA in Production, use /PWA in the command below on the Test / Dev environment.




Verification :


Get-SPProjectWebInstance –URL <PWA URL> | Select ProvisioningStatus




Source of article is : http://pwmather.wordpress.com/2013/05/02/projectserver-2013-environment-migration-rollover-steps-powershell-ps2013-msproject-sp2013/


Other Links :


http://technet.microsoft.com/en-us/library/ee890097(v=office.15).aspx









Wednesday, September 24, 2014

Cannot Remove Server Reference from Farm CacheHostInfo is null

He states “We can’t provision, unprovision, start, or stop a Cache Service because we still have a Cache Service that has no server attached.”
Not exactly my problem, as I had a Cache Service that seemed to have two non-existent servers semi-attached. But his Scripts were the starting point for resolving my issue. I ran them in this order:
Need the Farm name:


$SPFarm = Get-SPFarm


Need the Cache Name:


$cacheClusterName = "SPDistributedCacheCluster_" + $SPFarm.Id.ToString()


Need to use local (only) server as ClusterManager:


$cacheClusterManager = [Microsoft.SharePoint.DistributedCaching.Utilities.SPDistributedCacheClusterInfoManager]::Local


Need the Cluster name:

$cacheClusterInfo = $cacheClusterManager.GetSPDistributedCacheClusterInfo($cacheClusterName)


Need the Instance name:

$instanceName ="SPDistributedCacheService Name=AppFabricCachingService"


Need the service instance for the missing <computername>

$serviceInstance = Get-SPServiceInstance | ? {($_.Service.Tostring()) -eq $instanceName -and ($_.Server.Name) -eq "<computername>"}


Need to delete the instance reference:


$serviceInstance.Delete()


Repeat last two steps for second non-existent server.
Set new information: 
$cacheClusterInfo.CacheHostsInfoCollection
Just for good measure, on the Services on Servers page, stopped and started Distributed Cache Service. 
Then went to Servers in the Farm page and manually remove the servers successfully.
Back in PowerShell console, I used Install-SPSolution to manually redeploy the solutions again even though they displayed as deployed on Solutions Management page.
Everything is back and working correctly
For your farm you may need to re-add instances of the Distributed Cache Service on existing servers in your farm with PowerShell:
Add-SPDistributedCacheServiceInstance
At least I am learning. The last time the Distributed Cache Service was corrupted, I just gave up and re-built my farm.




Ref:
http://summit7systems.com/cannot-remove-server-reference-from-farm-cachehostinfo-is-null/#comment-1962