Russia had Muslims forever. Their Muslims learned the limits and how to behave.
Russia really did the best job of all the Europeans, when it comes to Muslims.
We have our German empress, Catherine, to thank for this to some extent.
But its roots go even deeper, to the Russian conquest of the large Tatar khanate of Kazan. That was the first time that several million Muslims joined Russia. The Tatars eventually became our ambassadors to the Kazakhs, Kyrgyz, Turkmens, and so on. In fact, we basically outsourced our Muslim policy wholesale to the Tatars.
The Tatars became merchants, missionaries, and diplomats of the Russian tsar - showing the other Muslims peoples we came into contact with, that Orthodox and Muslims can peacefully coexist.