Live WordPress Site to Localhost: The Right Way to Move!
This write-up will throw light on an easy technique to move live WordPress site to localhost.
The way to grabbing the “successful” title for any budding company or entrepreneur is full of ups and downs. However, the number of downs or ups one faces in this journey depends mostly on their decisions.
For a tech entrepreneur, it is super essential to deliver a brilliant project to stand out. And to accomplish that, all factors of creating a website or an app should be kept in perspective- be it speed, performance, or development time.
While various factors depend on multiple other characteristics, there’s one thing that you can control- modifying or developing your website in less time than expected!
And what makes it possible? The process of easing development to accelerate the growth and efficiency of the entire project. Thus, developers globally choose to move live WordPress site to localhost.
The “strategy” of move live WordPress site to localhost would help you understand WordPress in-depth and efficiently and quickly test your website.
It would be better to hire developers who hold excellent knowledge and experience in WordPress so that “controlled experiments” can be made to your live website’s data.
Why Should You Consider WordPress Migration to A Local Server?
If you already own a WordPress website, chances are you are considering making timely upgrades, modifications, and introducing new features into it to maintain consistent growth.
Thus, it becomes essential to test out freshly released plugins and themes before integrating them into your website to ensure continual user engagement.
But the fact that bothers entrepreneurs the most is the right way to check these modifications while blocking out all possibilities of disrupting the website’s user experience.
Well, where there’s a will, there’s away. You can hire WordPress developers to professionally import the website to a local server without disrupting the website’s outlook.
This way, you can quickly test new themes and plugins or carry out other testing-related work without hampering the user experience.
The process will allow your developers to integrate the modifications only after being properly tested, thus not exposing your website to site breaks.
Not only that, many developers prefer practicing it out to get more in-depth knowledge and grasp on skills related to WordPress.
Although testing out the changes is possible with the dummy content of WordPress. However, the actual website data will offer you a more in-depth visual interpretation of the change of your site’s aesthetics once modifications are implemented.
How to Move Live WordPress Site to Localhost?
The first and foremost step required to facilitate a successful website migration to a local host is to back up every website’s data before doing anything else.
The backup will ensure all your data is safe, and you can move back to the start point of migration if any problem occurs midway.
Secondly, the developer you hire would install a local server environment into the device/computer.
For windows, the developer can use WAMP, and for Apple devices, MAMP is used.
Once the environment is ready to use, you should build a new database through phpMyAdmin.
You can also visit the following URLs in your browser to launch phpMyAdmin.
- http://localhost/phpmyadmin/
- http://localhost:8080/phpmyadmin/
Next, you should choose the “Databases” tab to create a new database. This database will be used later while you are unpacking the live site data.
Now you are all ready to import your WordPress site on to localhost.
How to Copy Live WordPress Site to Localhost Manually
To use this method, you would have to hire WordPress experts to migrate your WordPress website to a local server.
But before going ahead, remember, you should always create a reliable backup of your data before you actually migrate your website so that nothing goes haywire.
Since that is established, let’s move to the process.
Step 1: Export the Live Site’s Database
The developer will have to log into the cPanel dashboard and then select phpMyAdmin to export the live data.
Note: The images here are of the Bluehost dashboard (an example for better understanding)
In the phpMyAdmin, choose the database you wish to export and then select the “export” tab.
Here, the phpMyAdmin will ask for your preference between the custom and quick export method. We recommend you opt for the custom method and use the zip in the compressed form.
You can also create tables inside the database through various WordPress plugins. However, if you want to keep it original and not use any plugins, these tables can still be integrated through the custom method.
Skip the “quick export” and select “custom export” with the “go” button and download your zip file consisting of your database backup.
phpMyAdmin will now download these files.
Step 2: Download All of The WordPress Files
The next thing you have to do is download every file of your website. The process is simple- you have to select the file-containing folder and create a compressed zip file.
Once your zip file is ready, choose the file and select “download.” After this, the zip file consisting of all your codes will be downloaded.
Step 3: Migrate the Files to Localhost
Once you have downloaded each of your WordPress files successfully, it is recommended to build a folder on the local host to import WordPress websites easily.
In case you use MAMP, you should ask your developer to create the folder within the /Applications/MAMP/htdocs/ folder.
However, if you use WAMP, the folder has to be built within the folder C:\wamp\www\ of the localhost.
Once done, you can just copy and paste the compressed file downloaded earlier and decompress them.
Now you can move ahead in importing the database by accessing the admin panel present in the localhost via the URL:
- http://localhost/phpmyadmin/
Now you can simply select the “already built” database and click on the “import” tab placed at the top.
If not that, you can also create a fresh database and then import the old database (that of a live website) it.
Locate the “choose file button” and make a click for uploading the database export file that your developer would have downloaded in the first phase of migrating the live WordPress site to the local server.
Click on “go” to move forward.
The phpMyAdmin will move on to unzip and import the database of your WordPress website.
Since now the entire database has to be set up, it is preferred to update all URLs inside the WordPress website that is live.
You can do it through a phpMyAdmin SQL query. Make sure to select the database of your local website and then choose SQL.
This query will pick the URL references of your live website and replace them with localhost’s URL.
UPDATE wp_posts SET guid = replace(guid, 'http://olddomain.com', 'http://newdomain.com'); UPDATE wp_posts SET post_content = replace(post_content, 'http://olddomain.com', 'http://newdomain.com'); UPDATE wp_links SET link_url = replace(link_url, 'http://olddomain.com', 'http://newdomain.com'); UPDATE wp_links SET link_image = replace(link_image, 'http://olddomain.com', 'http://newdomain.com'); UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com'); UPDATE wp_usermeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com'); UPDATE wp_options SET option_value = replace(option_value, 'oldurl.com', 'newurl.com') WHERE option_name = 'home' OR option_name = 'siteurl';
Step 4: Update the wp-config.php File
The last step of the process of migrating the live WordPress website to a local host would be to make sure the local site’s wp-config.php file is up to date.
This website consists of your site’s settings, including crucial information of forming the connection with the database.
Find your way to the folder with WordPress installed on the local server, and then move to the wp-config.php file in a text editor like notepad.
Change the name of the existing database with the one built earlier by your developer (using phpMyAdmin).
/** The name of the database for WordPress */ define('DB_NAME', 'database_name_here'); /** MySQL database username */ define('DB_USER', 'username_here'); /** MySQL database password */ define('DB_PASSWORD', 'password_here');
Once that is done and dusted, change the username of the database and put it exactly like your current MySQL username; if you are using any password, enter that. If you don’t wish to do that, you can also leave it empty and end by saving all the changes you have made.
Voila! Your live website is now available in the local browser!
Hats off for all the hard work and smart decisions.
Recommended Posts
5 Easy Steps to Create an Event Registration Form in WordPress
December 1, 2024
Best Black Friday Deals for WordPress 2024
November 19, 2024
How to Sell Online Courses with WordPress in 2024
August 4, 2024
You seem to have forgotten to tell us to update the siteurl and home fields in the options table.
Thanks for noticing that, take a look at step 3, there are related SQL commands added to change siteurl.