So there were a few stages of deployment when it came to phasing out the traditional musket.
Firstly they began to switch over from the traditional flint lock mechanism to the percussion lock style of musket which occurred in many militaries throughout the 1830s.
From 41 onwards the Prussians began to use the needle gun which was a breech loaded rifle, it wasn't the first of its kind with weapons like the Ferguson Rifle dating back to 1776 however later in the 1862 a newer version of the rifle that was more reliable and easier to mass produced was developed. This allowed the Prussians became the first to adopt a breech loaded weapon as their standard issue infantry weapon.
Meanwhile from 1849 onwards with the invention of the Minie rifle in France the various leading militaries of the world began to adopt rifled muskets based on the weapon. These were still muzzle loaded weapons as breech loaded weapons were more expensive and less reliable generally.
As for cannons technically they aren't. Weapons of 20mm or greater used with a relatively flat trajectory are considered a cannon. However if you specifically mean a smooth bore muzzle loaded cannon then from 1858 onwards rifled artillary began to become more common and in 1870 the first breach loaded cannons began to emerge.