Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ozmander

macrumors newbie
Original poster
Jul 10, 2008
5
0
I've used Finder tags to sort a large database on my existing MacBook AIr.

Now it has come time to migrate to a new MacBook Air but I cannot find any documentation on how to transfer the tags over along with the file.

I use Google Drive to host and sync my files. I did a trial run and the tags did not transfer. Hope someone can help me!
 

chown33

Moderator
Staff member
Aug 9, 2009
10,996
8,880
A sea of green
  1. Compress the files and folders into a zip file. (Right-click, choose "Compress")
  2. Copy the resulting zip file to Google Drive.
  3. Copy back to new computer.
  4. Unzip.
  5. Confirm tags were transferred.
Or you could use any external media, such as a USB drive or an SD card. Then simply copy the files and folders to the external media, and copy them off to the new computer.
 

treekram

macrumors 68000
Nov 9, 2015
1,849
411
Honolulu HI
  • Like
Reactions: NoBoMac

Brian33

macrumors 65816
Apr 30, 2008
1,472
372
USA (Virginia)
You could use Migration Assistant to transfer files, accounts, preferences, apps, etc. from the old Mac to the new one. Surely it would preserve Finder tags.
 

NoBoMac

Moderator
Staff member
Jul 1, 2014
6,254
4,940
Agree with Migration Assistant. Or, make a TimeMachine backup. Or setup sharing between old and new and drag/drop over.

Because, big issue, tags are stored in a folder's .DS_Store file and in the extended attributes file for a file (.something.xattr if I recall correctly).

So, a cloud copy might not preserve the attribute file. Possibly same for copying to exFAT/NTFS drive (assume should work, but never know what oddness one might run into). USB drive formatted as HFS should preserve with simple copy.

And even then, might need to run the Spotlight reindex command on the new Mac. From Terminal:

Code:
sudo mdutil -E /
 

chown33

Moderator
Staff member
Aug 9, 2009
10,996
8,880
A sea of green
Because, big issue, tags are stored in a folder's .DS_Store file and in the extended attributes file for a file (.something.xattr if I recall correctly).
As far as I know, there are no tags stored in a .DS_Store file. A folder's tags should be stored in the xattr's of the folder itself.

One can see a full list of the xattr's for a file or folder using a Terminal window. Paste this command into the window and press RETURN.
Code:
ls -leaO@
The output will list a number of attributes for the entire contents of your home folder: access permissions, ownership, locked state, mod date, name, followed by the list of xattrs by name and size.

One can then 'cd' (change directory) to any readable folder, and give the same command.

To learn more, see the man page for the 'ls' command.
 

NoBoMac

Moderator
Staff member
Jul 1, 2014
6,254
4,940

Thanks for the link.

For my sanity, and if others stumble on to this in the future...

The link and some digging, seems like attributes are stored in, for simplicity sake, the volume's file table in each header chunk for a file (where stuff like, create/modification/used dates stored, size of file, owner, etc). Eg.

https://developer.apple.com/library...Conceptual/ManPages_iPhoneOS/man2/stat.2.html

As the link points out, if you copy a file that has tags to a exFAT thumb drive, attributes get preserved via a hidden file. HFS to HFS should preserve as well (basically, anything copied between Macs and HFS/APFS file systems).

Cloud services, odds not as they are probably just doing a block copy of the file and not extracting attributes from the file's header (add: though I did stumble upon some Google Drive APIs that allow an app/program developer to add attributes to an object, so possible in theory).
 

Attachments

  • tagged_file.png
    tagged_file.png
    33.7 KB · Views: 231
  • exfat_attr.png
    exfat_attr.png
    84.9 KB · Views: 246
  • exfat_contents.png
    exfat_contents.png
    229.7 KB · Views: 256
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.