404 Page Not Found Error After Migrating from MOSS 2007 to SharePoint 2010
After migrating from MOSS 2007 to SharePoint 2010, All the Sub-sites scolded me with: 404 Page Not Found error! But still able to get into the inner pages/document/site settings.
Common causes for HTTP 404 Not Found issue:
- Verify the Host header in IIS and make sure its valid.
- Managed Path which were present in old environment may not be there in New Environment.
- Alternate access mapping – Make sure you have the Alternate access mapping set correctly and you are accessing using the right alternate access mapping, access your site with FQDN. If you are accessing the site using IP address, then update your DNS Entry/HOST file
But in this case, all above things were set to right. Looked at the event viewer, Logs files but could not figure out the cause of this problem.
Verified Welcome page settings, Confirmed that the Default.aspx exists in the site by Opening site in SharePoint Designer.
After scratching the head and with little trial and error figured out the solution: Check-out “Default.aspx” file and check-in back!!!
Wrote a PowerShell script to do Check-out and Check-in. In my case, I wanted to apply this fix for all sub-sites, So the code goes like:
$SPsite = Get-SPSite <SITE-COLLECTION-URL>
foreach ($SPweb in $SPsite.AllWebs)
{
$SPFile = $SPWeb.GetFile("default.aspx");
$SPFile.CheckOut("Online",$null);
$SPFile.CheckIn(1);
$SPweb.Dispose()
}
$SPsite.Dispose()
I get 404 Error for all the subsites when i use different alias name
Example : migrated the SP 2007 to 2010
with a hostname https://intranet
added the new hostname {IntranetUpgraded} to IIS and tried browsing with the new hostname.
the root pages come up
https://IntranetUpgraded
but subsites
https://IntranetUpgraded/sites/subintranet
throws 404 but
when i replaced the hostname with https://intranet/sites/subintranet it works
any advise would be appreciated
Hi Salaudeen
Thanks for this. It has worked well for me on a number of occasions – except for one.
In this particular migration, the checkout call fails with the error “the file xxxx/default.aspx is checked out for editing by domSPFarmSetup”.
SPFarmSetup is the account I am logged in with and is the account used to setup the SharePoint farm. Needless to say it has full rights across the web applicatoin and is a farm admin.
I have tried doing it via SharePoint Designer as well, but there I get a similarly obtuse error message. If I try to check it in, I get “Cannot perform this operation. The file is no longer checked out or has been deleted.”
I am given the option of Undoing the Checkout, which appears to work, though still elaving me woth the 404 error. If I then try to check it out and in again I get the same error.
Are you aware of any way I can get around this – or to force the check in/out process?
Hi Andrew,
This could be caused by various reasons. Try these things and revert to me back if any of the below works for you..
* Edit the properties of the page/file and Make sure your file has all the mandatory fields values supplied.
* If your page is based on content type: Go to site actions > Site settings > Site Content Type > and Pick the content type of your page , set the fields (such as “Title”) to “Optional”
* This Could be of alternate access mapping issue – Make sure you have the Alternate access mapping set correctly and you are accessing using the right alternate acccess mapping (Dont open the site using “localhost:port” or “hostname” instead of full host name like “Company.HostName”) access your site with FQDN. If you are accessing the site using IP address, then update your HOST file
* clear your cache – Delete everything under these folders:
c:UsersYOUR-USER-NAMELocal SettingsApplication DataMicrosoftWebsiteCache
C:UsersYOUR-USER-NAMEAppDataRoamingMicrosoftWeb Server ExtensionsCache
* Check if you have any event handler, try disabling them.
* Check whether the Master page/Page layout associated with your particular page is checked out. If so check them in back.
Check this KEDB: https://support.microsoft.com/kb/2273439
Try check-in from Browser rather SPD.
Thanks for this, it is helping. However, is there a way for the Invoke-SPFileCheckin.txt to recurse the folders within the document library? We have serveral libraries with subfolders within subfolders and recursing would help a lot. Thanks.
Sure, Use: Find All Checked Out Files and Check-In them Back using PowerShell