When migrating a Craft site, I'm used to...
- deploying files
- checking my config, tweaking as necessary
- loading a database backup
- running "Update Asset Indexes" and "Clear Caches" from the control panel
That last step is always important because random oddities and broken images are fixed site-wide because of caching and transforms. Now I'm attempting to automate the process with a Docker deploy script, so I'm wondering: is there any way to Update Asset Indexes and Clear Caches programmatically?
I know that you can nuke the craft_assettransformindex
table and delete the contents of /craft/storage/runtime/assets
and /craft/storage/runtime/cache
(related question), but is that really doing the exact same thing?
Note that by "programmatically," I generally mean anything you could achieve from a Linux terminal: MySQL commands, PHP or shell scripts, etc.