Script to migrate websites?

I might be asking for a lot, but I can’t use the cpanel migration tool for some reason, and I’m considering moving websites one by one to a new VPS with virtualmin installed on it.

I was wondering maybe one of you already did such a thing and has a script somewhere to automate the process?

I just need to move the websites (I don’t need ftp users, emails, server config, etc), so on the old vps it would just be archiving the files and downloading the databases, and on the new vps using the virtualmin cli to create new sub-servers, upload databases, and extract archives.