It's important to be absolutely clear on what is being sold. Using English translations may affect the outcome.
Assuming "SoleTraderCompA" is an Einzelunternehmen, the sale would be an asset sale. The company isn't sold, because the company is legally identical to person A! Instead, person A makes an extensive list of all assets he's selling (goods, real estate, intellectual property, etcetera). "SoleTraderCompA" might be a trade mark, in which case the trade mark can be sold.
Person B can also be an Einzelunternehmen, and as part of its business operations buys aforementioned assets from person A. But in general, any legal entity can buy the assets of person A, including a GmbH or AG.