How to safely abandon an ubuntu session?

I am trying to migrate a huge database into an Ubuntu 18.04 server but is there a way that even if i was to lose the connection(vpn or ssh) somehow, it will keep running the migration in the background and i can attach that session when i reconnect and ssh back in?