You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

After Data Migration from Time Machine, Spotlight fails search localized under user home folder

After a hardware repair, I restored user data from Time Machine using Migration Assistant.


Spotlight now has a strange error: When searching "This Mac", it CAN find any file. But when localizing the search to a folder under my user home folder, e.g., Downloads, if fails to show any results at all.


Here we see the search finding results by using "This Mac"


Below, we see no results when looking for the same file but narrowing the search to ~/Downloads:



This also happened a month ago on two different computers. On both computers the problem was resolved by reinstalling macOS (which was Monterey on both).


Today, I have had to bring the same Time Machine onto the machine again after Apple replaced the logic board.


Now, on Ventura, I did the macOS re-install, thinking that would solve the problem.. but this time it did not. Spotlight still cannot find anything when doing a search on a folder under ~/.


I have also done two techniques to cause spotlight to reindex the drive:

1) mdutil -E /

2) Put Macintosh HD in the Privacy list under System Settings/Siri & Spotlight. Close System Settings, reopen, and remove Macintosh HD from the privacy list.


Oddly, in both cases, there was no change in behavior. I would have thought that mdutil -E / would have caused spotlight to stop working for a while as it rebuilt the indices... but no. Searching using the Finder search continued to give exactly the same results as before running the command.


Also oddly, I put my user home folder into the Privacy list, and while it was there, I could still find files under my user home, as long as it was searching "This Mac".


This makes me speculate that somehow the Data Migration brought over an extra Spotlight index (which is not getting erased), and that the identity of my user home folder is somehow not recognized as being the same. (A vague idea, I know.)



One other data point. For folders outside my user home, (e.g. /Applications or /Library) The finder search has no problem doing a search localized to that folder:


Any ideas on how to solve this?







MacBook Pro 16″, macOS 13.1

Posted on Jan 8, 2023 1:04 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 9, 2023 7:02 AM

SOLVED.


I used the procedure documented at

Change the name of your macOS user account and home folder - Apple Support


Then, when I logged back into the newly renamed user, and ran the test to search just within Downloads folder, it looked like it was still a failure.. for about 15 seconds, and then the search results started to show up.


I then repeated the procedure of renaming the user account and home folder back to their original names.

Restart mac. And Viola! Searches within folders under the user home folder now work correctly (and with no delay).


I was concerned that the user name change might wreck my ability to pull data from my Time Machine drive (the one that the Migration Assistant brought over onto this computer.)


Fortunately, after the two renames (back to the original) I can still browse the Time Machine Drive.


As a side note, when Time Machine used HFS+ (macOS Journaled) formatted drives, you could browse an unencrypted Time Machine drive even if you were not the original user.


Now, on APFS formatted drives, it is much stricter--- unless you did a Data Migration from that Time Machine drive, there does not seem to be any way to access user documents on the time machine drive.


This came up when I was doing a "clean install" during one stage of this long saga of troubleshooting my laptop. Even though I created the new user with the same name, I was unable to get any of my data from the Time Machine drive.


Similar questions

3 replies
Question marked as Top-ranking reply

Jan 9, 2023 7:02 AM in response to keithbjohnson

SOLVED.


I used the procedure documented at

Change the name of your macOS user account and home folder - Apple Support


Then, when I logged back into the newly renamed user, and ran the test to search just within Downloads folder, it looked like it was still a failure.. for about 15 seconds, and then the search results started to show up.


I then repeated the procedure of renaming the user account and home folder back to their original names.

Restart mac. And Viola! Searches within folders under the user home folder now work correctly (and with no delay).


I was concerned that the user name change might wreck my ability to pull data from my Time Machine drive (the one that the Migration Assistant brought over onto this computer.)


Fortunately, after the two renames (back to the original) I can still browse the Time Machine Drive.


As a side note, when Time Machine used HFS+ (macOS Journaled) formatted drives, you could browse an unencrypted Time Machine drive even if you were not the original user.


Now, on APFS formatted drives, it is much stricter--- unless you did a Data Migration from that Time Machine drive, there does not seem to be any way to access user documents on the time machine drive.


This came up when I was doing a "clean install" during one stage of this long saga of troubleshooting my laptop. Even though I created the new user with the same name, I was unable to get any of my data from the Time Machine drive.


Jan 8, 2023 1:12 PM in response to keithbjohnson

Give this a try: boot into Safe Mode according to How to use safe mode on your Mac and test to see if the problem persists. Reboot normally and test again.


NOTE 1: Safe Mode boot can take up to 3 - 5 minutes as it's doing the following; 

• Verifies your startup disk and attempts to repair directory issues, if needed

• Loads only required kernel extensions (prevents 3rd party kernel/extensions from loading)

• Prevents Startup Items and Login Items from opening automatically

• Disables user-installed fonts 

• Deletes font caches, kernel cache, and other system cache files


NOTE 2: if you have a wireless keyboard with rechargeable batteries connect it with its charging cable before booting into Safe Mode. This makes it act as a wired keyboard as will insure a successful boot into Safe Mode.


After Data Migration from Time Machine, Spotlight fails search localized under user home folder

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.