Save site as template in SharePoint 2013

Add-PSSnapin Microsoft.Sharepoint.Powershell
$web = Get-SPWeb “http://xxxxx:6892/yyy/zzz/”
$web.AllProperties[“SaveSiteAsTemplateEnabled”] = “true”
$web.Update()

Now in your Publishing site navigate to http://sitename/_layouts/15/savetmpl.aspx and you would see the old Save Site as Template Page

http://xxxx/_catalogs/solutions/Forms/AllItems.aspx

SharePoint custom timer job cache issue

• Stop the “SharePoint 2013Timer” service.
• Delete all the XML files in the Config cache. There are loads of XML files that can be found in the folder “C:\ProgramData\Microsoft\SharePoint\Config\”. Note there seems to only ever be one folder under Config which has a GUID. There are other folders which map onto this folder, but this one seems to be on every environment whereas the other locations may be found in different places on some environments. Therefore deleting the files from this folder should work in all environments.
• Edit the “cache.ini” file in the same folder that contained the XML files, setting the content to “1″ (without the double-quotes). This indicates that all cache settings need to be refreshed. Eventually this value gets automatically updated to another number when the cache is repopulated.
• Start the “SharePoint 2013 Timer” service.

Visual studio cache clearing

With many problems, such as the infamous Red X issue, the common resolution is often to flush the local cache by completing the following steps:
1.Delete the contents from the following folders ?C:\Users\<>\AppData\Local\Microsoft\Team Foundation
?C:\Users\<>\AppData\Local\Microsoft\VisualStudio
?C:\Users\<>\AppData\Local\Microsoft\VSCommon

2.Go to the Visual Studio IDE folder in command prompt and Run the following command “devenv/resetuserdata” from the Visual Studio IDE folder. ?Typical location for 64 bit: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
?Typical location for 32 bit: C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE

While this feature has its place, it needs to be used with some pre-Enter-Key thought and planning, and anyone recommending this to anyone should also highlight the side effects … or face a VERY unhappy customer.

Devenv.exe/ResetSettings

Clear temp data in SQL and SharePoint database

DECLARE @DB VARCHAR(255)
DECLARE C CURSOR FOR
SELECT NAME FROM SYS.DATABASES WHERE IS_READ_ONLY=0 AND STATE=0
AND NAME NOT IN (‘master’,’model’,’tempdb’,’msdb’)
OPEN C
FETCH C INTO @DB
WHILE @@FETCH_STATUS=0
BEGIN
EXEC SP_DBOPTION @DB,’trunc. log on chkpt.’,’true’
DBCC SHRINKDATABASE (@DB)
FETCH NEXT FROM C INTO @DB
END
CLOSE C
DEALLOCATE C

Follow below link, to reduce database or log files after above execution

http://sensoft2000-sharepoint.blogspot.ae/2014/10/how-to-shrink-wsslogging-database.html