WordPress site to a different server without losing any data
Migrating (or) Copying a WordPress between two hosting is a segment tricky process. Below the easiest way to Clone or Copying your site follow the instruction step by step. Then you will get the easy way to Migration
In the website that you have Site X and Site Y and you might want to clone Site X to Site Y, So here the steps below.
You Must backup the Site X and Site Y by using Backup Plugin All-in-One WP Migration Plugin (or) Log on to hosting which one you having and go to control panel and create backup Site X & Site Y. You can Install BackUpWordPress and generate latest site & database Backup. Just download all the files (or) if Site B is hosted on VPS hosting then download backup using wget command through SSH
Create a Database on Site Y, Important! note down the database credentials. Upload the backup file on Site Y path. Make sure Site Y root (public_html) has extracted files, not the zip file.
Open wp-config.php find under Site Y path and use the database details which you beforehand noted down in step 2. Once you updated to save the file and close it
Go to Site Y phpmyadmin and select the Site Y database which you have created in Step 2. Then get wp_options file find site URL & home rows and edit the Site Y URL.
Find .htaccess file under Site Y root and change the URL from Site X to Site Y, if it is not there anywhere then close the file without saving. If you on Nginx server then make the changes in nginx.conf from Site X to Site Y & directory locations.
Login to Admin Site Y admin URL and use the username & password of Site X. Once you login change the watchword if required generally go to Setting and change the Blog Name & Description.
Then your site is live now working but in media links & page, post links are going back to Site X. To change them follow the below one more steps
Download plugin Velvet Blues Update URLs, install the plugin and activate. Then go to Tools (From Left Sidebar under admin) > Update URLs. In Old URL section put your Site X URL and in New URL Put your Site Y URL and select all Options under it but make sure you leave “Update ALL GUIDs”. Then click Update URLs Now.
It’s Complete! All Site Y URL is changed including links & media & other URL. In some cases, some images are missing but in that case, you will have to update them manually.