Deploying a webapp? subdomain it

I’ve been migrating domains from an old server to a new one that we’ve just acquired. Some were really straightforward standalone CMS setups, so a tar xcf and an scp followed by a mysqldump and a mysql < database.sql sufficed.

But there were ones that had multiple webapps running off the same domain. I had a Piwik installation on, then a random dokuwiki setup running at While it’s all too easy to simply create a subfolder and dump the files in, a setup like this makes incremental migration very difficult. When you cut over the DNS records for the domain from an old IP to a new IP, everything needs to work at the first try.

A better way is to have each webapp run in a seperate subdomain. Instead of, set it up at Instead of, set it up as Sure it’s a few extra steps when setting up, but ┬ádecoupling your webapps is good practice.

When it’s time to move one of the webapps to its own server, or migrate your domain incrementally, you can simply copy over all the files for that one webapp, repopulate the database tables, do a test run using your HOSTS file, then flip the switch at your DNS server when you’re ready. The big win? Everything else on continues to hum along swimmingly.