Chinese yam (Dioscorea oppositaThunb. cv. Tiegun), a type of homologous medicinal plant, mainly grows in sandy soil (SCY) and loessial soil (LCY). However, the effects of the soil on the metabolites in SCY and LCY remain unclear. Herein, this study aims to comprehensively elucidate the metabolites in SCY and LCY. A UPLC-MS/MS-based, widely targeted metabolomics approach was adapted to compare the chemical composition of SCY and LCY. A total of 988 metabolites were detected, including 443 primary metabolites, 510 secondary metabolites, and 35 other compounds. Notably, 177 differential metabolites (classified into 12 categories) were identified between SCY and LCY; among them, 85.9% (152 differential metabolites) were upregulated in LCY. LCY significantly increased the contents of primary metabolites such as 38 lipids and 6 nucleotides and derivatives, as well as some secondary metabolites such as 36 flavonoids, 28 phenolic acids, 13 alkaloids, and 6 tannins. The results indicate that loessial soil can improve the nutritional and medicinal value ofD. opposita.