One of the SharePoint performance best practices is to have your most used files like (master pages, page layouts, ...) as ghosted files instead of having them customized in the content database.
While rushing to deliver the project we may miss this practice, by having these files customized in the content database using SharePoint designer.
You will find your files in 3 statuses:
- Un-Customized (Ghosted): No customization has been done on the file (deployed by a feature).
- Customized (Un-Ghosted): Already has a ghosted version but someone edited the file in the SharePoint designer. So, it has a customized version in the content database.
- None: Actually it's a customized file but doesn't have an original ghosted file.
The aim of this tool is to help SharePoint developers to find out what are the files that are customized (Un-Ghosted) and make it easy to convert them back to un-customized (Ghosted) ones. Following these simple steps you can solve this problem:
- Open the SharePoint Ghost Files Manager tool and select the web application, site collection and the list that contains your files.
- Save the files you need to revert back to un-customized (ghosted) version by clicking "Save" button beside each file. This will save this file content to the disk. and displays and message box with the saved file location.
- If you already have a feature for deploying these files, just update their content in your feature from the saved files, deploy your feature then go back to the tool and click "Revert" to revert back the file to be ghosted again.
- If you have created these files by copying or uploading them to SharePoint designer directly, It's time now to create a SharePoint feature to deploy your saved files. Make sure to create a feature that deploys these file but using different file names,
then deploy the feature to your SharePoint environment. Go back to the tool and select the un-ghosted file and click "Ghost", select the file that you deployed using the feature to wire the un-ghosted file to this ghosted one.