Let's say you have yourdomain.com and you want to make stage.yourdomain.com in one command.
In your SSH run:
Code: Select all
sudo /usr/local/vesta/bin/v-clone-website yourdomain.com stage.yourdomain.com
And that's all, the script will clone your site.
WordPress, Joomla and Open-Cart will be detected automatically, no need to enter DB credentials manually.
Want to copy stage back to production?
In your SSH run:
Code: Select all
sudo /usr/local/vesta/bin/v-clone-website stage.yourdomain.com yourdomain.com
If you are making two or more copies, our strong recommendation is to add parameter: --DATABASE_SUFIX=_name_of_new_site
Code: Select all
--DATABASE_SUFIX=... (default is '_migrated')
Code: Select all
sudo /usr/local/vesta/bin/v-clone-website yourdomain.com stage1.yourdomain.com --DATABASE_SUFIX=_stage1
Code: Select all
sudo /usr/local/vesta/bin/v-clone-website yourdomain.com stage2.yourdomain.com --DATABASE_SUFIX=_stage2
In order to copy to some specific database name, use: --TO_DATABASE=myuser_exactdbname
Code: Select all
sudo /usr/local/vesta/bin/v-clone-website stage1.yourdomain.com yourdomain.com --TO_DATABASE=myuser_wp
For custom CMS
In case that you want to clone custom CMS which doesn't store files outside of /public_html folder and there is only one config file, run:
Code: Select all
/usr/local/vesta/bin/v-clone-website domain1.com domain2.com --CMS_TYPE='other' --CONFIG_FILE='config.php' --FROM_DATABASE_NAME='myuser_db' --FROM_DATABASE_USERNAME='myuser_db' --FROM_DATABASE_PASSWORD='mysqlpass1234'
Code: Select all
/usr/local/vesta/bin/v-clone-website domain1.com domain2.com --CMS_TYPE='other' --SITE_SUBFOLDER='..' --SEARCH_FOR_CONFIGS_DATABASE_NAME=1 --CONFIG_FILE='public_html/config.php' --FROM_DATABASE_NAME='myuser_db' --FROM_DATABASE_USERNAME='myuser_db' --FROM_DATABASE_PASSWORD='mysqlpass1234'
--CMS_TYPE='other' If CMS is different from WordPress, Joomla or Open-Cart
--SITE_SUBFOLDER='..' If there are files outside of /public_html folder, use this command to navigate up one directory level. Or you can use this command to navigate directly to subfolder where all files are stored
--CONFIG_FILE='config.php' If there are files outside of /public_html folder, you have to set path to config file, '/public_html/config.php'
--SEARCH_FOR_CONFIGS_DATABASE_NAME=1 Used in case that CMS has multiple config files
Keep in mind that you have to manually read database name/username/password from config file and insert those information in script.
See source code of the script for all available parameters: v-clone-website