Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Some tips for migrating data from NFS to AFP System
I'm migrating to Mac OS X 10.4 Server, and in the process decided to migrate from our legacy NFS share points to AFP share points. However, when Mac clients mount over NFS, they generate ._ files as well as the normal ones. So saving a file called HelloWorld.txt would result in a near duplicate file ._HelloWorld.txt in the same folder.

So I wanted to copy all of my User data onto a newly formatted HFSX partition, whilst preserving file creation times, owernship, and so forth. The problem is that using the built-in Mac OS X rsync tool resulted in a writefd_unbuffered error, and in any case, would just copy the ._ files faithfully to the new HFSX drive, which would then not be picked up by Spotlight (since it would probably look in the resource fork itself).

In the end, the easiest way to do it was to use the zip utility. Running it with -X -y -r was enough to preserve extended information (-X), as well as symlinks (-y) and recursively (-r). When unzipping it onto an HFSX drive, the ._ files are seamlessly merged with the meta information, which is then Spotlight-indexable. So, after a tortuous route copying files, formatting the drive, and copying back again, I can now start installing Mac OS X Server! Read on for a few things to note...

A few points worth noting:
  • I've not verified what happens when an existing file has resource forks. Either it will be merged sensibly, or the resource data stored in the ._ will get preferential treatment, or vice versa.
  • The zip files don't seem to preserve ownership IDs, though they do preserve the read, write, and execute bits. Actually, they might work, but since my OpenDirectoy is down, it can't resolve the UIDs anyway, so it may be showing my user by default
  • I had a few problems copying files, with zip saying I/O error: invalid argument (input file read failure). Some -- but not all -- of these I managed to resolve by deleting the corresponding ._ file. In other cases, I used the folder action 'Make archive,' which runs the zip file as well, though I've yet to verify whether that stores the symlinks or extended attributes
You should also be careful when using rsync that comes with Tiger. It doesn't seem all that stable, and if you're used to doing -cav (the -a standing for archive, or everything) does not imply the -E option. Why Apple couldn't have made it the default whether you needed it or not is beyond me.

The plus side is with all this copying, Spotlight should have no excuse for not indexing the entire set of user content that's going on the hard drive.
    •    
  • Currently 1.40 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[10,249 views]  

Some tips for migrating data from NFS to AFP | 2 comments | Create New Account
Click here to return to the 'Some tips for migrating data from NFS to AFP' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Some tips for migrating data from NFS to AFP
Authored by: mayo2ca on Jul 22, '05 02:50:45PM

I don't think zip will preserve file ownership, so all the files get the ownership of the person who extracted them. One way to preserve the permissions is to use tar with -sp flags. Then zip the tar if you need compression. (-j will bzip and -z wil gzip the output file automatically). When you extract the tar, OSX should merge the special files as well.

In unix, if the system can't resolve UIDs (such as when the directory is down or user has been deleted) it will show the numeric IDs. I'm not sure about 10.4, but 10.3 behaved this way too, and I don't see any reason why Apple would screw with this.

m



[ Reply to This | # ]
Some tips for migrating data from NFS to AFP
Authored by: alblue on Jul 23, '05 02:54:59PM

I tried the tar approach; it just faithfully restored the ._ files as well, as opposed to merging them into the metadata.



[ Reply to This | # ]