Do you use MacPorts for your development? In a need for a new Mac, but do not have the time to set up your whole development environment all over again?
I’ve just received my new MacBook Pro, and thought I’d share the problems that occured during the automatic file transfer from my old MacBook Pro to the new one, both running Leopard 10.5.
I was a bit sceptical of this whole automatic tranfer process, because my PHP 5, Apache, MySQL, PostgreSQL were all installed using the package system MacPorts, and I wasn’t sure if the automatic transfer would recognise these installations and just transfer normal OS X applications and files.
Luckily, during the transfer, you get the options to chose which files you want the installation to transfer. Remember to select the checkbox called “all files and folders on Macintosh HD”. The transfer was flawless in all aspects for me, regarding OS X specific applications. It copied all of my files in the /opt-directory - MacPorts still worked!
There were some small adjustments i had to do to make this work from the transfer installation with my old files. This is right after the first booting of the new system:
Apache
I tried to start Apache the normal way:
$ sudo /opt/local/apache2/bin/apachectl start (48)Address already in use: make_sock: could not bind to address [::]:80
Oops. Seems like the “Web sharing” option in Mac OS X is turned on by default. I went to System Preferences -> Sharing and turned off Web Sharing. Tried again.
$ sudo /opt/local/apache2/bin/apachectl start httpd: Syntax error on line 114 of /opt/local/apache2/conf/httpd.conf: Cannot load /opt/local/apache2/modules/libphp5.so into server: dlopen(/opt/local/apache2/modules/libphp5.so, 10): Library not loaded: /usr/lib/libltdl.3.dylib\n Referenced from: /opt/local/apache2/modules/libphp5.so\n Reason: image not found
Now I though that maybe my MacPort installation was corrupted during the transfer, but after some googling I realised that libtldl is a dependency of MacPorts, coming from XTools. Strange - XTools weren’t copied with all of my other files. I whipped out the Mac OS X Install DVD Disc 2 and installed XTools.
$ sudo /opt/local/apache2/bin/apachectl start
Ahh yes, my Apache working!
System settings
But wait a minute, where are my local hostnames? Seems like the tranfer process neglected my /etc/hosts file. Copied it over and everything was A-OK.
PS: By a coincidence i still used Mac OS X’s default vhost apache config file with my MacPorts Apache installation from the days before installing MacPorts. The default config file was erased and replaced by a default apache config file by the installer.
/private/etc/apache2/extra/httpd-vhosts.conf # Default Apache config file /opt/local/apache2/conf/extra/httpd-vhosts.conf # Default MacPorts config file
Conclusion
- The transfer copies all of your files to the new Mac.
- All default configuration files there’s no GUI to modify will be replaced by factory settings.
Avoid using default OS X config files if you can. This advice can easily be followed by using MacPorts, as all of MacPorts’ content should be placed in the /opt-folder.
Hopefully this short post will be of help for others considering to make the jump to a newer computer.


Leave a Reply