Disclaimer: I don't know anything about CalDAV and CardDAV and how Thunderbird handles them. However, I hope I can give some general guidelines.
Comparing directory trees and files in Linux using a graphical UI
Some of the other answers / comments have proposed to take a backup of your profile, delete one of the CalDAV / CardDAV connections, and check what has changed in the profile. I think that this is a very good idea if you really want to take the time (which could be a lot) and research the problem.
However, I also think that using
diff for that purpose (and in general) is a torture. Since you are using Thunderbird, you are on a graphical desktop and thus can use
meld, a graphical application with a nice UI which finally makes comparing whole directory trees in Linux a pleasure. If you are using a reasonable Linux distribution,
meld should be available by means of your package manager.
Finding a non-perfect, but quick-and-working solution
While I understand that you would like to have the perfect solution and want to understand in detail what is happening, it might sometimes be better to be pragmatic (notably if there is some sort of time pressure).
I think we agree that deleting something usually takes no time compared to researching a problem or creating something. So I would just copy the whole Thunderbird profile from the main machine to the second one and then delete all mail accounts on the second one.
Since deleting a mail account does not necessarily remove the local data (in case of POP3) or the cached / synchronized data (in case of IMAP) associated with that account from the local file system, we need to do an extra step if we want to save disk space or if we have privacy concerns:
Before deleting an account, select the submenu entry
Server Settings for that account in the left pane, then copy the location in the line labeled
Local directory to a safe place, e.g. a text file. After having deleted the account itself, delete that directory. By this step, you are deleting the actual messages associated with the respective account from the local file system.
Please note that there are other files which you might want to delete, for example the address books (
*.mab) and various other
.sqlite files which might reveal personal data. This might or might not be a problem in your case. This additional data usually does not take up much disk space, so you might just leave it in place if you don't have privacy concerns.
If you would like to know more about the Thunderbird profile folder layout, you could use this starting point.