Copy all nodes under drupal7-menu
$ Menu_name = 'menu-main-menu-us'; function _ node_setup ($ node) {// domain option set to United States $ node-> domain_site = FALSE; $ node-> domains = array (2 => 2); $ node-> subdomains = array (0 => 'United States'); return $ node ;} $ menus = menu_tree_all_data ($ menu_name); function _ menu_recursion ($ menus) {foreach ($ menus as $ menu) {if (preg_match ("/node \/(\ d +)/I", $ menu ['link'] ['link _ path'], $ matches )) {$ node_id = $ Matches [1]; // clone node $ oNode = node_load ($ node_id); $ node = clone $ oNode; $ node-> nid = NULL; $ node-> vid = NULL; $ node-> tnid = NULL; $ node = _ node_setup ($ node); node_save ($ node ); // reset menu $ menu_obj = menu_link_load ($ menu ['link'] ['mlid']); $ menu_obj ['link _ path'] = 'node /'. $ node-> nid; $ menu_obj ['href '] = 'node /'. $ node-> nid; menu_link_save ($ menu_obj);} if (! Empty ($ menu ['below']) {_ menu_recursion ($ menu ['below']) ;}}_ menu_recursion ($ menus );