将MAMP Pro转移到具有新用户名的新Mac

时间:2018-01-26 21:50:28

标签: apache rename virtualhost httpd.conf mamp-pro

mysql56 目录和 settings4.plist 复制到新Mac上的相应位置。问题是,我在新Mac上使用不同的用户名,因此所有虚拟主机路径(根目录)都不正确 - 它们包含以前的用户名。

当然,我可以通过MAMP Pro gui手动更新每个,但我有超过100个虚拟主机名。我想更新两个httpd.conf文件(~/Library/Application Support/appsolute/MAMP PRO/httpd.conf和  /Library/Application Support/appsolute/MAMP PRO/conf/httpd.conf)会解决问题,但事实并非如此。

相反,它会在Apache启动后将两个httpd.conf文件重新写回旧用户名。

有没有一种简单的方法可以解决这个问题?

1 个答案:

答案 0 :(得分:0)

This is a late reply to when OP posted, but I recently encountered this problem too when transferring hard drives.

I was able to fix this by copying and replacing the full folders of BOTH:

/Users/yourUserName/Library/Application Support/appsolute/MAMP PRO
(minus the db folder unless you want to transfer those too)

and

/Library/Application Support/appsolute/MAMP PRO/conf

Once I replaced these, all of my previous hard drive's virtual hosts appeared.

If your username and root directory are different, you most likely will need to do a text search and replace. Replace the old path with your new path on both httpd.conf files and the httpd-ssl.conf (if you used SSL) which are in the folders I listed above.