Add this code to functions.php
of your current theme ( preferably child theme ):
$menuName="Your menu name";
$locationID = 'primary';
$myMenu = get_term_by('name', $menuName, 'nav_menu');
$locations = get_theme_mod('nav_menu_locations');
if($myMenu->term_id !== $locations[$locationID]) {
$locations[$locationID] = $myMenu->term_id;
set_theme_mod('nav_menu_locations', $locations);
}
Remember to change values of first two variables to match your requirements.