localhost

Migrate a live WordPress to localhost

In the following guide, we’ll explain to you just how you can move a live WordPress website to your local machine.

Why transfer a live WordPress to local ?

People make a copy of their live website on local server to examine brand new themes, plugins, or perform development testing. This permits you to set your theme with your articles and test all of the attributes without worrying about breaking up your website.

Though you can perform all of the testing using dummy content in WordPress, actual website data offers you a much better visual representation of just how these modifications will show up on your live website.

Whether you’re transferring your WordPress website to another domain name, or by WordPress.com to self-hosting, or into your localhost, then it’s strongly advised that you copy your whole web site .

Transferring with a plugin

First thing, you have to download, install, set up and activate the duplicator plugin in your live website. Duplicator plugin permits you to create replicate package of your complete WordPress website. It may be used to change your WordPress website to somewhere else, and may also be utilized as a backup plugin. Upon activation, the plugin provides a fresh “Duplicator” menu on your WordPress admin sidebar.

Duplicator – WordPress Migration Plugin

To create a new bundle, you have to click the create new package button. Duplicator will begin developing a package of your complete WordPress website. This might take some time, based on the amount and the size of files you have in your live website. Once completed it’s going to redirect you to the package display, revealing recently generated package with an installer file. To move your website you need to download the zip package and the installer file to your local host.

Your server requires a new mysql database, so you must have a database on the local server. You can use phpMyAdmin for example. As soon as you’ve established the database you have to copy paste the package and installation file into an empty folder on the local host’s directory. To run the setup script, you must start the install file on your internet browser. You may access the installer into your browser by visiting http://localhost/mywebsite/install.php. You will now see the Duplicator setup.

Provide your local host’s database informations. The server is normally the localhost. In case you haven’t established a new user for MySQL onto your website, then you should create one (you can do that when you create the database). It’s possible to use the root account, but it’s not recommended. Last, you have to enter the database name that you created.

The installer will extract your database and WordPress files from the zip package and import them. Based upon how big is the package, this might take a little while. When the installer has pulled the files and import sucessfully the saved database, then it is going to redirect you to the upgrade page.

On this page, you have to provide the URL of your website and the URL of the website in your local host. The plugin will automatically discover these values. Be sure they’re right and then click the upgrade button. Duplicator plugin will update URLs in your database.

That is all ! You’ve moved your live website to a new server. The installer will show you a success webpage. You would also have to upgrade permalinks (Settings > Permalinks) in the local host website and delete the installer file and bundle.

Migrate to local without plugin

In case the plugin doesn’t work for you, then you can always manually transfer your live web site to the new server. The very first thing you’d need would be to back up your site manually. We recommend using phpMyAdmin to export your WordPress database.

To export your live website’s WordPress database, You have to on phpMyAdmin and choose the database you wish to export and then click on the export tab on the top.

PhpMyAdmin will ask you to select either custom or quick export method. You should choose the custom and picking zip line as the compression procedure.

Occasionally WordPress plugins may make their own tables within your WordPress database. If you aren’t using one of these plugins , then the customized method permits you to exclude these tables. Leave remainder of the choices as they are and click the Go button to get your own database backup in zip format.

As soon as you have downloaded your database backup, the next step is to download your WordPress files. To do this you will need to link to a WordPress site with an FTP client like Filezilla. Download all of your WordPress files and folder to your PC. Downloading all of your files might take a while depending on how many files, and their sizes, you have on your site.

After downloading your WordPress files, copy paste these files on the local server folder in which you need to set up WordPress.

On the localhost, you have to create a database to your WordPress website. To do this, you have to start http://localhost/phpmyadmin/ on your browser and make a new database. After making the database, click the select file button to pick the WordPress database export file that you downloaded and click to submit. PhpMyAdmin will import your database and will give you a message when it’s completed.

Now your database is set up, You have to upgrade the URLs within your WordPress database referencing for your live website. You can achieve it by conducting a SQL query in phpMyAdmin. Ensure that you have selected your regional site’s database and click SQL. In phpMyAdmin’s SQL display copy and paste the next code. Check : be certain you replace example.com with your live website’s URL and localhost/test-site together with the local host URL of your website.

UPDATE wp_options SET option_value = replace(option_value, 'http://www.my-website.com', 'http://localhost/my-website') WHERE option_name = 'home'OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.my-website.com', 'http://localhost/my-website');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.my-websit.com','http://localhost/my-website');

The last step is to change few lines into the wp-config.php file. You have to go to the folder in which you installed WordPress in the localhost and edit wp-config.php file in a text. Replace database name with the one that you created in phpMyAdmin for your localhost. Replace the username along with the local mysql username. Do the same, if needed, for the password.

define('DB_NAME', 'database');
define('DB_USER', 'username');
define('DB_PASSWORD', 'password');

Your live website is now duplicated to a localhost setup. Have a good development!

Still stuck ? You can contact an expert.

Leave a Comment

Your email address will not be published.

You may also like