Cloning a Hosting can be useful to have another hosting service, using another domain name or subdomain with the same web data of the original hosting. In this manual we will show you how you can clone your Hosting hosted in a Cloud with SWPanel.
danger This cloning method is only applicable to hostings that are hosted in a private Cloud with SWPanel.
If you do not have a Cloud with SWPanel, you can contract one and move your hosting into it, following the instructions in the following manuals:
Below, we mention the data and features will be cloned on the new hosting:
The following features/content is cloned:
- Hosting Content
- Hosting Databases
- PHP and WordPress settings of the Hosting
The following features/content is NOT cloned:
- Email accounts
- DNS records
- FTP accounts
- Crons
info The new database and database user will have the name "clon_" or "clone_", followed by the original name of the database or user. Example:
- clon_BBDDoriginal
- clon_usuarioBBDDoriginal
info You must keep in mind, for the cloned Web to work correctly, you will have to reconfigure the connection to the internal DB and possibly relative URL links that your Cloned Web is using. If you do not make these modifications, the cloned website will still be connected to the source website's database and it is possible that some web links are still using the source domain name.
In case your cloned website is a WordPress, we provide you with all the modifications you would have to make in order to make your WordPress site work with the new URL.
info By default, your cloned WordPress will remain connected to the original DB and will continue to use the URL of the original domain. In order for your Cloned WordPress to load your content correctly with the new domain name, it will be necessary:
- Connect your WordPress to the Cloned DB.
- Replace the old WordPress URLs in the Cloned DB with the new URL.
This is the access data that WordPress uses to connect the website to the database. You will need to enter the name of the cloned DB and the cloned DB user.
info The names of the cloned DB and the cloned DB user, you can consult them by accessing Service management --> Database management.
The lines to be modified are the following:
/** The name of the database for WordPress */
define( 'DB_NAME', 'NAME_WP' );
/** MySQL database username */
define( 'DB_USER', 'USER_WP' );
You can access phpMyAdmin by entering the URL of your domain, followed by "/phpmyadmin":
Once inside, you can modify the old URL to the new URL by placing the following command in SQL queries if your WordPress was installed through SWPanel:
UPDATE wpsw_options SET option_value = replace(option_value, 'dominioantiguo.com', 'nuevodominio.com') WHERE option_name = 'home' OR option_name = 'siteurl';
If your WordPress was not installed through SWPanel, you can use the following:
UPDATE wpsw_options SET option_value = replace(option_value, 'dominioantiguo.com', 'nuevodominio.com') WHERE option_name = 'home' OR option_name = 'siteurl';
info The prefix of your WordPress tables may NOT be wpsw_. In case that is not the prefix we will have to check which is the correct one from the left panel, changing the prefix wpsw_ for the corresponding one.
You can check the changes. By expanding the wpsw_options, table, checking the siteurl and home, fields, they will have the new URL we have previously set:
We can make these changes automatically, using the free plugin "Search & Replace".
To do this we will have to access the administrator area of our WordPress.
danger Important! The WordPress login and password you received in your email are not valid. Since all your WordPress data is cloned, including your username and password, you will need to use the username and password of your original WordPress for the time being.
Once inside the admin area, go to Plugins → "Add new plugin", find the "Search & Replace" plugin and click "Install now" --> Activate:
Then click on the 'Search/Replace' tab.
Enter your old URL in the first field called "Search by:", example: antiguodominio.com
Enter your new URL in the second field titled "Replace with:", example: nuevodominio.com
Select all tables.
Uncheck "Drill".
Select "Save changes to database".
Click on "Find and Replace".
danger In case the cloned website has been a subdomain of the original domain, it is possible that we have lost the access by action of the plugin. To recover it, we will have to edit again the parameters site url and home in the wpsw_options table, removing duplicate text:
success Done! Your WordPress is correctly configured with the new URL.