I have a reseller account with hostgator, which means i have WHM and Cpanel. I have set up a staging environment for one of my wordpress installations (client website), which is essentially sitting at staging.domain.com (live site is at domain.com). The staging website is a complete copy of the live website and utilises a different database.
The idea behind this is to test all new module updates / wordpress updates prior to releasing to the live website, however.. Content can chance on the live website without the staging website receiving the updates (want to use this as a backup also.)
What I want to do is set up a daily CRON job to copy the database from one hosting account to and replace another database. (tables and all) on a daily basis. I figure this will only be possible at host manager level (WHM) as a cpanel user will not have permission to interface between 2 different accounts.
Does anyone know how to do this? Do I need to create a PHP script to run every day? What would that look like.. Sorry I know its a big ask, im just clueless at this level.