I have a Wordpress site with hostagator web hosting , I am buying new domain and want to use new domain for site but same existing developed si
Here I will explain how to take back up manually and restore manually on another server with other domain name. Backup: You need to take back up of site and database.
For site, you can take only back up of wp-content. It contains all data you need to resore. STEP1 : cpanel-file manager-public html- (wp-content)- compress & save- export or download zip file. For database: phpmyadmin -> export databse. This gives you localhost.sql file.
These two files one .zip file and another .sql file are your back up. (It is good to remember user id password of wordpress dashboard of this one)
Restore in another server on another domain:
After you get you new domain dns propagated on new server, open its cpanel. Run wordpress script , see database name it is creating. 1) database restore: MyphpAdmin->Database created by wordpress->check all tables->drop all tables. Now your database is clean without any table.
In your loacalhost.sql file remove two piece of codes: a)any signature like this (it should be on top) -- phpMyAdmin SQL Dump -- version 4.8.5
-- Host: localhost:3306 -- Generation Time: Oct 14, 2019 at 09:45 PM -- Server version: 5.6.45 -- PHP Version: 7.2.7
soniasin_fitfoody
CREATE DATABASE IF NOT EXISTS soniasin_fitfoody
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE soniasin_fitfoody
;
-->Now, go to import and import, select your back up .sql file-> go. It will import all tables in your this database. --> There is a database table now like wp_option, go there & edit siteurl (keep your new domain name), home (keep your new domain name) and admin email id.Very important. Site Restoration:
1) Go to public html folder. Remove directory wp-content. 2) Import your back .zip file here and unzip. 3) You will find on wp-config.php file in public html folder, open it and update table prefix. $table_prefix = 'wp_'; Here yo have to see what is your table prefix. Check database tables and see what prefix is in all tables. Here in this example it was 'wp_' , therefore kept it. 4) Now log in to you wordpress dashboard. It will take username of old site now and should take old password too. In case you forget password, change it and then open. Now wordpress will confirm that your database is changed, say ok and proceed. Your site should be running on new URL now on another server.
In case of doubt, you ask me. If one want to watch any video here goes the link https://youtu.be/wROa37k_RQA.