Just found this ( apologies for a bit of a long cut and paste but interesting!
Aside from the language links, the history of links between Scotland and Germany is rooted in trade. Long before Germany existed as a nation, during the Medieval period, Scottish traders were drawn to do business with the Hanseatic League, who operated from ports around the Baltic Sea, including those on the northern coast of Germany.
Trade with the German ports of the Hanseatic League was so important in Scotland that William Wallace, after his victory at Stirling Bridge in 1297, wrote to the governments of Lubeck and Hamburg to thank them for their support. He reassured them that now the English army had been beaten, German merchants would find it safe to trade in Scotland once more. Robert the Bruce also wrote to Lubeck in 1321 to strengthen trade between Scotland and the towns of ‘Alemannia
During the 15th Century, Scottish merchants trading in Germany were not always viewed positively by the locals. Laws restricting Scottish (and English) trade were introduced. Scottish settlers were sometimes viewed as an unwelcome minority group in Germany. Some moved on to Poland. But many others remained. However, throughout this and the following century, Scots continued to emigrate to Germany from Leith, Dundee and especially Aberdeen. Not all were wealthy merchants. The Duke of Prussia complained, in 1558, of pedlars and vagabonds from Scotland causing ruin to his subjects with their travelling trade !
Many more Scots made their way to Germany in the 17th Century to fight in the Thirty Years War. Thousands of Scottish soldiers fought in this conflict, on all sides and for all nations. Many settled in the region. Many Scottish academics also made their way from Scotland to Germany and strong educational links were forged. Germany’s religious divisions meant that both Calvinists and Catholics also sought refuge from religious persecution in the country. Ratisbon (modern day Regensburg) was particularly popular as a place of learning for the sons of Scottish Catholic families.
I think the first para is what you were meaning.
This is how I get stuck on my iPad for hours- one thing leads to another!