Pre-WWII Shanghai — then the Paris of the East — had a large Jewish population — because the so-called International Settlement did not require a visa of fleeing German Jews and already had large Baghdadi and Russian Jewish populations.
The Kaifeng Jews, by contrast, had already been in China for a long, long time:
Most scholars agree that a Jewish community existed in Kaifeng since the Northern Song Dynasty (960–1127), some date their arrival to the Tang Dynasty (618-907) or earlier. Kaifeng, then the capital of the Northern Song Dynasty, was a cosmopolitan city on a branch of the Silk Road. It is surmised that a small community of Jews, most likely from Persia or India, arrived either overland or by a sea route, and settled in the city. In 1163 they reportedly built a synagogue surrounded by a study hall, a ritual bath, a communal kitchen, a kosher butchering facility, and a sukkah.
During the Ming Dynasty (1368–1644), a Ming emperor conferred seven surnames upon the Jews, by which they are identifiable today: Ai, Shi, Gao, Jin, Li, Zhang, and Zhao. By the beginning of the 20th c. one of these Kaifeng clans, the Zhang, had largely converted to Islam. Interestingly, two of these: Jin and Shi are the equivalent of common Jewish names in the west: Gold and Stone.
The Jews who managed the Kaifeng synagogue were called “Mullahs”. Floods and Fire repeatedly destroyed the books of the Kaifeng synagogue, they obtained some from Ningxia and Ningbo to replace them, another Hebrew roll of law was bought from a Muslim in Ning-keang-chow in Shen-se (Shanxi), who acquired it from a dying Jew at Canton.