I could import the database and FTP the files but would this rebuild the Media Library as well as keeping the images attached?
No rebuilding or reattachment would be required at all. The database *is* your site, and then it tells WordPress where to find uploads while content from the database is being sent to browsers for display. However, you will be “moving WordPress” (database and uploads), and that will require updating the database so it can know what URL to expect coming in from browsers and to also tell WordPress to use as just mentioned.
Here is the SQL code I use for doing that:
UPDATE pref_options SET option_value = replace(option_value, 'https://www.olddomain.com', 'https://www.newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE pref_posts SET guid = replace(guid, 'https://www.olddomain.com', 'https://www.newdomain.com');
UPDATE pref_posts SET post_content = replace(post_content, 'https://www.olddomain.com', 'https://www.newdomain.com');
note: Edit ‘pref’ (three places above) to your own table_prefix and change ‘https://www.olddomain.com’ and ‘https://www.newdomain.com’ as required (three places each and with no trailing slashes).
Then, you will also need to be certain your database name, user, password and table_prefix at the server are also in wp-config.php. And finally, it is at least possible you might have a plugin using “absolute server path” that will have to be uninstalled and re-installed so it can update its own awareness as to how to find WordPress, the database and/or uploads.