Here’s a possible workflow. Adjust and customize as appropriate for your personal workflow and environments.
domain.com/site1/ -> /var/www/site1
– configure the server and database
– install and buildout WordPress
domain.com/site2/ -> /var/www/site2
– branch version control from site1
– dump mysql from site1
– write a script to do the following
—- update wp-config.php with necessary changes
—- mysql dump file search/replace domain.com/site1/ with domain.com/site2/
—- Note: search/replace needs to be adjusted for your install and serialized data
– create new database and restore from the new mysql dump file
If using .htaccess, it should work on a basic install.
If not using .htaccess, you will probably want to setup something like
<Directory ~ "/var/www/site[0-9]{1}">
# ... directives here ...
</Directory>
Or, you can script out another process for updating your <Directory> directives.
The above should work on most installs and configurations. If you have a highly customized install or some plugins, you may need a more complex update script. The workflow is essentially the same as moving a WordPress install to a new domain, except you’re keeping the old site live.