I migrated a SMF 1 Forum - which to my knowledge is prettey similar in database-structure as SMF 2 - to Flarum in the past.
https://discuss.flarum.org/d/3585-smf2-to-flarum-migration-script-alpha-3/52
The GitHub-Repo for the script is here: wolfgang-demeter/smf2flarum
While some things might work out of the box others most certainly require tinkering with the script and tuning the SQLs or handle (skip) corrupted data or attachments. It's like hrvoje_hr said, it's messy work. You do a test-migration on a dev/test server, check the errors, handle them and do it all over again. And don't forget to recruit some of your forum members (Mods, Admins) to test the test-migrations.
It's tedious but it's totally worth it. I'm so happy with Flarum. It's a really awesome Forum solution without the clutter and weirdness of old forum systems - like SMF, phpBB and others.