Shelter-in-Place Journal, Day 323

There are two kinds of people in the world: those who want to do things the easy way and those who write shell scripts. I’m in the latter category.

This difference came to light again during a call with Bob, my successor as Webmaster for Toastmasters District 101, this afternoon. He wanted to set up a staging site for a (much-needed) redesign of the site and clone the current site to it. The first step was to use the DreamHost control panel to set up a new subdomain; that was easy.

If I’d been setting up the new site a month ago, my next step would be to create a new MySQL database for the new site, then into the shell account on DreamHost and run a shell script I’d written that would copy all files from the current site’s home directory to the new subdomain’s home directory, copy the database from the current site to the new one, update a few items in the database to reflect the new subdomain and I’d be finished. Elapsed time usually under 5 minutes.

Bob didn’t want to rely on my script (especially since I’m trying to disengage from the Web team). He expected that DreamHost, like most web hosts, would have a simple way to clone a site to a staging site. It does, but it was not easy to find; first we had to install WordPress, log in, reset the admin password, log in again, get a “migration key”, install a plug-in on the current site, and finally he was able to get the site cloned. Elapsed time about 40 minutes, but it doesn’t rely on an admittedly-fragile shell script, and it’ll take a lot less time next time. I hope he took notes.