
2 answers

- Setup the data model first:
1. Create a Custom Field of type text called "Contract Number" on the Contract object and mark is as an "External ID", this is a tick box on step 2 of the wizard.
2. Create a lookup field on the Loaction Object that looks to the Contract object.
Use the Data Loader (EE or UE required) to do run an Upsert:
1. Load the Contracts.
2a. Load the Locations, when choosing Upsert you will be prompted in the 3rd step (I think) to select which field(s) that have been flagged as External ID's to use that will tie the two objects together, you shold see the Lookup field you added in step 2 of the data model setup.
2b. When doing the field mapping, make sure you choose the relation field not the Lookup itself.
and that should be it...