Microsoft recommends using SharePoint Migration Tool whenever possible. This approach will work only if you want to migrate from SharePoint 2010, 2013 and 2016 to SharePoint Online. For migrations of SharePoint 2019 on-premises to SharePoint Online you need to use third party tools. Our recommendation is to use a combination of SPMT and a third-party tool.