Hi there, yes it’s possible to transfer the roles, but there will be some reconfiguration required. For the file server you can use a tool such as robocopy to mirror the files to the new server. It will even copy NTFS permissions over. You can also use the Microsoft File Migration Tool Kit.
To transfer the domain controller role to a new server you will need to promote another server to a domain controller and then transfer the FSMO roles from your old domain controller to your new domain controller using the NTDSUTIL tool. You can use the instructions here. Also make the new domain controller a global catalog server. Then wait for replication to complete between the domain controllers and then you can finally demote the old domain controller with dcpromo.