Setting up a relay is quite easy. With https://github.com/fiatjaf/khatru it takes about 3-5 commands to get it running.
A guide to set-up a relay https://andreneves.xyz/p/set-up-a-nostr-relay-server-in-under
To migrate data i would recommend using nak where in one command you can replay the events to your new/custom relay. You can for example just replay your own events, or only by the people you follow. Example command to replay to another relay in NAK docs -> https://andreneves.xyz/p/set-up-a-nostr-relay-server-in-under