You can migrate files from a backup if the backup storage is connected when you first set up your new Mac.
Image credit: Apple Inc
Prepare a backup for migration
Q
How can I make a bootable backup of my old Mac to migrate to a new Mac mini M4?
by GEOFF LINKLATER
A