I want to get backup of whole production org using ant migration tool
and to verify if the backup works fine I want to deploy the same in a test sandbox
what are the steps required to do both?
You will come across many blogs/resources providing the point of view. Here are some:
https://help.salesforce.com/s/articleView?id=000386692&type=1
https://help.salesforce.com/s/articleView?id=sf.admin_backup_metdata.htm&type=5
https://www.syscloud.com/saas-data-protection-center/salesforce/salesforce-metadata-backup/
Basically, it starts with having the ANT related software/setup done. Post that you may have the right set of package.xml and project manifest, to pull all the metadata on to your system/server. Many CI/CD tools provide this capability OOB.
Regards,
Kannan