The principal genetic demographic parameters that describe migration processes affecting the structure of the St. Petersburg population gene pool were determined on the basis of the demographic statistics obtained from the Petrostat Agency, All-Russian population censuses, and a sample survey of St. Petersburg residents. The migration coefficient was 0.36 according to the survey data, 0.42 according to the 2002 census, 0.44 according to the 2010 census, and 0.69 according to the 1897 census. The estimated average migration distance was 1746 km from the survey data, 1526 km according to the 2002 census, and 1652 km according to the 2010 census. The sources of the St. Petersburg population gene pool in different periods are discussed: in the 18th and 19th centuries, the main source was the population of the Upper Volga and Northwestern provinces of the Russian Empire, as well as foreign immigrants, whereas currently three quarters of the population gene pool originates from the Northwestern Federal District, 10% comes from natives of foreign countries, and only 6-9% is due to the population of the Central Federal District of the Russian Federation. An analysis of the Rosstat migration statistics showed that the composition of migrants by countries of exit varied over time. For instance, the share of migrants who arrived in St. Petersburg from Russia in the last five years ranged from 74 to 87%. In 2013-2014, most international migrants came from Uzbekistan (10% of all arrivals) and Tajikistan (3-4%), while in 2017, the countries with the highest number of migrants ranked as follows: Kyrgyzstan (almost 4%), Ukraine (about 2%), Belarus (1.5%), Kazakhstan (1.25%), and Armenia (1%). Migration processes determine the dynamics of the ethnic composition of the population. Gender differences in migration flows are manifested in different age structure and in unequal sex ratio within particular ethnic groups (e.g., predominance of men in the "young" ethnic diasporas: Armenians, Azerbaijani, and Uzbeks). The described features of migration processes in St. Petersburg should be taken into account when forming genetic marker databases for the purposes of DNA-based identification. The areas of migration attraction of St. Petersburg and Moscow overlap only partially, which predetermines the need to create separate databases for each megacity.