In OS X, if you have this kind of popup when copy-pasting a folder with lots of subfolders in it:
A newer folder named “subfolder_name” already exists in this location. Do you want to replace it with the older one you’re copying?
It means that: The subfolder’s content is going to be replaced (delete the previous sub-folder and paste the new one) instead of being merged.1
This sounds obvious but even after years of using OS X (since 2010) I’ve always thought that the behaviour for this kind of action would be replacing the files but still merging the subfolder content instead of replacing it like how it would be done on Windows or Linux.
This no brainer behaviour could lead you to a dumb disaster like I did yesterday when I decided to “manually update WordPress on my localhost”:
- Downloaded the latest version of WordPress
- Unzipped it. Note that it had
- Copied all files and folders from the unzipped folder
- Paste ‘em all on localhost’s WordPress folder. Having the popup mentioned above appeared and without further thinking, clicking the replace button because I thought it’ll replace files but merging the sub-folders (like how it is done on Windows / Linux)
- All custom plugins and themes on the
After hours of googling and trying to resurrect the file using third party file saver apps, the replaced files and folders couldn’t be restored. It becomes tricky for the
wp-content/uploads/ folder but luckily I have all of custom plugins and themes backup-ed on the private git repositories.
- Always have a backup
- Finder is even more unreliable.
Sometimes, you’ll have popup which offer you options between merge or replace, but most of the time you’ll have this replace or stop options. ↩