As a result of the Treaty of Lunéville, Dillingen became part of the Bavarian Kingdom and was taken over by the Bavarian Army in 1803. Raglovich took part in the campaigns of 1805, 1806/07, and after that was promoted to Major General and Brigadier in 1806, as chief of the general staff of the 1st Royal Bavarian Division in the campaign of 1809. In the battle in Russia he was wounded near Polotsk and repatriated. He fought in the Battles of Bautzen and of Dennewitz in Prussia. In 1813 he was promoted to Lieutenant General and divisional commander, and in 1814 he supervised the deployment of the Bavarian reserve army. In 1817 he became director of the topographic bureau, and transferred it to military institution. He initiated the foundation of the main conservatory of the army library. In 1819 he became member of the Bavarian Reichsrat. One year later he took office as Chief of the General Staff, and was advanced to "General der Infanterie" in 1823. In 1821 he became an honorary follow of the Bavarian Academy of Sciences and Humanities, and in 1829 he became chief of the 2nd section of the War Ministry.