U.N. members on Monday adopted a deal aimed at improving the way world copes with rising migration, but almost 30 countries stayed away from the ceremony in Morocco.