Clone a website from / to 'localhost' (using port forwarding) - ManageWP
Troubleshooting > Backup, Clone and Migration > Clone a website from / to ‘localhost’ (using port forwarding)

Clone a website from / to ‘localhost’ (using port forwarding)

You can use ManageWP clone option even if you want to transfer a WordPress site from (or to) your local computer, laptop or perhaps local web server.
When you have both source and destination sites accessible from the Internet, cloning becomes a breeze!

    1. Add the destination site to ManageWP (or use the new site option). However, adding the destination site option is safer.
    2. Add the source site to ManageWP

In order to add the site (either source or destination) from one of your local computers to ManageWP you will need to make it accessible from the Internet.
This is where Port Forwarding comes in place!

The concept of Port Forwarding is actually simple.

      • Everything you send and receive on the internet travels via your router – it is essentially the “gateway” between your PC and the internet.
      • Router’s public IP address allows it to communicate to other computers on Internet.
      • Computers on your home / SOHO network use private IP addresses (most commonly in form 192.168.x.x), that only allows communication between devices on local network, and with router.
      • Requests for information are made via ports. Picture ships docking, with cargo being loaded and unloaded, and you have the right idea.

Computers from Internet can access devices with private IP addresses only if proper port forwarding is setup on the router.

First, you will need to find your local computer IP. This can be done with the “ipconfig” command, you can read more about that on following link.

When this is complete, next step is to find your external IP address. Just visit the site: showip.net.
This is where the process can get complicated – you will need to setup forwarding in your router.

There are literally hundreds of router brands with different user interfaces.
Luckily for us, there is an enormously comprehensive guide to port forwarding here.

Please note, that in some cases, in order to add a site from a local machine, you will need to update the WordPress URL and the Site URL inside the General Settings of the site in order to include the external IP.

The address should reflect the pattern http://ipadress:port/webroot.

Example:

Your local web server resides on IP 192.168.1.12. It has Apache web server installed that listens on usual port 80.
If your public IP address is 202.202.202.202, you will pick an unused port (always above port 1024) – e.g. 20280.
After port forwarding is properly setup in your router, you should be able to access the server from Internet using http://202.202.202.202:20280
If this is still not the case, also check if your firewall is blocking the port 80 on 192.168.1.12.

When you are done with port forwarding, your site should be accessible from Internet.

Add the site to ManageWP with the IP address (and port) based path to the WP installation.
E.g. http://192.168.1.12/wordpress will become http://202.202.202.202:20280/wordpress.

Check your PHP memory limit and execution time localhost values and up them if it’s needed. Ideally PHP memory limit should be the same size or bigger then your site. Set the execution time to 600 seconds.

      1. Use the clone tool to clone the site from the localhost source site to the destination site (or vice versa). Here is a link on how to clone a site using Manage WP.
      2. If needed run the MySQL changer snippet
global $wpdb, $table_prefix;

$oldDomain = 'http://www.my-old-url.com';
$newDomain = 'http://www.my-new-url.com';

$wpdb->query("UPDATE {$table_prefix}posts SET post_content = REPLACE(post_content, '{$oldDomain}', '{$newDomain}')
");

Note:
To prevent issues, your best bet would be to use a different port. Because port 80 could be used, depending on your ISP equipment, for remote web management of router, or it’s used by some other program such as Skype.
This guide will show you how can you do this under Windows and with XAMPP.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

Do you need further assistance?

Contact our support team
These guys specialize in making customers happy

Over 17,000 WordPress professionals are already using ManageWP

Add as many websites as you want for free, no credit card required. Sign up and start saving time!

Have questions? Get in touch!

Over 17,000 WordPress professionals are already using ManageWP

Add as many websites as you want for free, no credit card required. Sign up and start saving time!

Have questions? Get in touch!

Over 17,000 WordPress professionals are already using ManageWP

Add as many websites as you want for free, no credit card required. Sign up and start saving time!

Have questions? Get in touch!

Over 17,000 WordPress professionals are already using ManageWP

Add as many websites as you want for free, no credit card required. Sign up and start saving time!

Have questions? Get in touch!