
I suggest you could use SharePoint Migration Tool (SPMT) which is a Microsoft developed migration tool available at no cost to migrate contents. To download: SharePoint Migration Tool. And it should be done in phases.
Before migration, you could use SharePoint Migration Assessment Tool which is a simple command line executable tool. It scans the contents of your SharePoint farm to help identify the impact of migrating your server to SharePoint with Microsoft 365.
Reference: SharePoint Server team sites Migration Guide
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.