In the Iron Age, a large hill-fort occupied the hill-top that now overlooks the moden-day Stratford sub Castle. The fort probably served as an administrative centre for the area and in common with other important hill-forts in the Wessex region, the hill-fort became the focus for several roman roads and a settlement called Sorviodunum developed close-by, probably in the area of the village of Stratford sub Castle. The defences of the hill-fort may have been brought back into use in the post-Roman period and Old Sarum is almost certainly the site of a battle between the British and Saxons in the mid-sixth century, recorded in the Anglo-Saxon Chronicle as being fought at Searoburh. 
Image: Iron Age Gatehouse, an illustration by Peter Dunn, with permission of English Heritage. Further images here.
Whilst there is little archaeological evidence of Saxon settlements, the presence of a number of inhumation cemeteries along the river valleys indicates that there were settlements nearby.  The threat of Viking attacks in the area in the late ninth century meant that Old Sarum  became a place of refuge for the local population. It is specifically mentioned in the Anglo-Saxon Chronicle in the description of the Danish attack on Wilton in c.1003. After that date the Wilton mint moved to Old Sarum and coins continued to be struck there until the reign of Henry II.
At the Norman Conquest, Old Sarum had become an important defensive and economic centre, with a castle founded by William I and a civil borough probably located outside the defences. The borough lay within a large estate owned by the Bishop of Ramsbury and Sherborne that extended from Woodford in the north to the confluence of the Avon and the Bourne in the south. Whilst the Domesday Book simply refers to this estate as ‘Salisbury’, there were a number of settlements within the estate, including Stratford sub Castle.
In 1075 the seat of the Bishop of Ramsbury and Sherborne was moved to the Borough of Salisbury and a cathedral church was completed by 1092. The cathedral and monastic precinct initially lay outside the castle defences within the area of the earlier hill-fort, but during the episcopacy of Bishop Roger (who had obtained custody of the castle) a wall was built on the line of the inner rampart, enlarging the castle to include the cathedral precinct. This action proved to be a source of friction between castle and clergy, eventually resulting in the removal of the cathedral from the hill-top to its present site.
Conflict between the castellan and the clergy is traditionally cited as the main factor in the relocation of the cathedral and the foundation of the town, but Old Sarum was clearly a difficult location for a major settlement and monastic site where even water had to be brought in. Economic factors were probably also instrumental in the decision to move. In the years around 1200, England saw a boom in new town foundations and the Bishops of Winchester were one of the principal founders of new towns in the south (including a new borough at Downton, just a few miles south of Salisbury). A new town provided the bishop with the opportunity to create a larger, more convenient site for the cathedral and to develop a market centre free from interference by the castle, where more trades and industries could flourish and so maximise rents and tolls. The idea to move the Cathedral appears to have been approved by Richard I in the 1190s, although lack of money and turbulence in church and state during the reign of King John prevented the plans being implemented. Despite this, discussions continued in chapter, and plans appear to have been developed for the buildings of the Close by 1213. In 1217, the year following the death of John, the Pope authorised the transfer of the cathedral to its new site in the meadows alongside the River Avon.
Source: Wiltshire Council City of Salisbury Conservation Area Appraisal and Management Plan May 2012
Available to download from Wiltshire Council's on-line Document Library
 Old Sarum