User Data Migration from HFS+ Disk Image

I got the following

  • source: the disk image of a iMac4,1 Intel32 from 2006 running the preinstalled 10.4.4
  • target: an iMac6,1 Intel32 from 2006 running the preinstalled 10.4.7

This use case isn't covered from the migration assistant, so:

Is there any way to apply all user data and installed programs from source to the target Mac?

My current status is:

  • I got both partitions on the target Mac's disk
  • I can access the source partition from MacOS, but not checkdisk.
  • I copied the user-data, but how do I register this new user with the system?
  • I copied the program I need, but now it is unregistered. Need the install CD.

I am a total Mac noob but rather familiar with low level linux.


Solution 1:

This is a rather broad question, so the answer will be somewhat broad as well.

Adding a new user

You can create a new user in System Preferences->Users & Groups. Once done you can then copy/move the copied user data into the newly created home directory and adjust ownership of files/directories.

There is a certain risk that some paths in configuration files etc will break, but this is hard to say from outside. You can reduce the risk by making sure the shortname of the newly created user is the same as it was on the old system.

Reinstalling an application

This heavily depends on the application in question. Some of them require just the .app directory to be copied, others have support files installed all over the system, and if they require registration it may again be somehow more complicated. To dig into this, please ask a new question and mention the name of the application.

PS: https://support.apple.com/en-gb/HT204320 implies that you should be able to select a mounted disk (partition) as a source for migration. But I don't have a way to verify that for 10.4.x.

Solution 2:

I finally solved the problem using the migration assistant.

You probably simply can attach the source disk to the target Mac using any USB external disk case. I did not try this because I don't have one at the moment, but 3 empty hot-plugging SATA bays.

I prefer standard tools where I know what they do, so my solution heavily relies on gparted and dd. If you are not familiar with dd abort here.

You won't need neither the source nor the target system's passwords.

Why do we need this at all? MacOS is not Linux, every installation is very hardware specific and simply transferring an installation from a different model won't work most of the times. (even Windows can do this!)

  • install hfsplus on your Linux PC to be able to handle Mac partition content.
  • does your target disk offer enough space for the source partition, the target partition used up space and the source data size?
    • if not: copy the target disk to a larger disk using dd. this will be your new target.
    • if yes: still make a backup of the disk with dd.
  • check if your target partition has free space more than the source partition data size
    • if not: use gparted to increase the target partition size until it can hold the source data.
  • read the source partition - the partition only - into an image using dd
  • use gparted to create a HFS+ partition on the target disk of at least the size of your source partition.
  • sudo partprobe to be sure the system re-reads the partition tables and we don't destroy any data because of an old table being active.
  • use dd to dump the source partition into the newly created partition
  • if you wish do fsck.hfsplus -f on the source and target partitions.
  • insert the target disk into the target Mac
  • boot using Command-S (Windows-S) for single user mode
  • again do /sbin/fsck -f if you wish. for me this did not work on the source partition
  • remount read/write using /sbin/mount -uw /
  • delete rm /var/db/.AppleSetupDone, this will make apple boot into the setup wizard on next boot
  • type reboot
  • in the setup wizard simply chose to migrate from other partition

That's it.

If you still need a password for your Mac, repeat the steps that initiate the setup wizard. From there do not migrate any data, instead a new admin user will be created.