Count Melchior Ferdinand von Gaschin wanted to make the hill the seat of Franciscans, and during the Swedish-Polish War, the order decided to close its houses in Kraków and Lwów and move to Silesia for safety, and an agreement was made under which they would take over the church on the Annaberg. 22 Franciscans moved there on 1 November 1655. The count had a simple wooden monastery building built and replaced the church with a new stone building which was dedicated on 1 April 1673. The church attracted increasing numbers of pilgrims and led to the hill's becoming known as St. Anne's hill. In addition to pilgrims' hostels and other infrastructure, in the 19th century, three publishing firms were established to serve the needs of pilgrims, by Franz Gielnik, Michael Rogier and Adolf Marcyago. In 1864, 400,000 pilgrims visited the church.