Immigrant viability is a major determinant of the realized rate of gene flow across populations. For social organisms, the social context in which immigrants disperse across contrasting environments may have important implications for their viability post dispersal. Here, we use social spiders whose individual personalities as well as group personality compositions vary across sites to test whether the strength of selection against immigrants (i.e. mortality rates) differs depending on whether spiders are transplanted (1) as individuals and remain alone, (2) join pre-existing colonies at their new non-native environment, or (3) move with their native group. We also tested for an effect of individual personality on survival. We found that social context, and not individual personality, affects individual survival in foreign environments with contrasting resource levels. Individuals that were transplanted with their native groups suffered higher mortality rates compared to individuals transplanted as singletons, regardless of whether or not they were assimilated into native colonies. Moving as individuals could thus provide an avenue for ongoing gene flow among populations from different resource environments. We found no depressed performance of control colonies that were transplanted across sites with resource levels similar to each colony's site of origin. These results are at odds with the intuition that dispersing as a group should generally enhance the viability of immigrants, at least in social species. We propose that these results could be explained by a mismatch in the ideal group compositions (personality compositions) favoured in different environments, despite a lack of selection on individual personality traits. These results provide a first glimpse into the relative roles of individual personality and social context in mediating gene flow among populations from divergent environments.