He went on pilgrimage to Jambi and Palembang, where he met the Arab religious teacher Shaikh Abdul Jalil, then journeyed with him to Java and India. He returned to the mainland from his exile in Langkawi and formally installed at the Balai Penghadapan, Istana Bukit Pinang, May 1710. He transferred his capital to Alor Star on 20 December 1735.[citation needed]