Finally you’ve built a site and you’re ready to show it for the whole world. But, wait, it’s on your local server. And none but you has the access to it.
Well, here is when you’ll have some more work to do to move WordPress site from local to live server. First of all you’ll have to find a domain name and choose among the variety of WordPress hosts. We’ve just published a post to help you with that.
After you’re ready with these two pre-steps, you may move WordPress from local to the live servers. And here you may find different variants to choose the most convenient and preferable one.
Method 1. Migrate with standard WordPress tools
WordPress includes built-in tool for import and export of all files and you may use it for site migration.
In the admin area of your local site navigate to the Tools -> Export and select ‘All content’. This will import ../move-wordpress-from-local-to-live-server/all your pages_ posts_ menu_ mediafiles_ etc. Just click on __8216.css;Download Export File’ to save it on your PC.
Then go to the live site (with the WordPress installed) and activate the theme you were using for the site. Once again go to Tools -> Import select and activate WordPress Importer plugin (if it’s suggested to you), and then use it to import the *.xml file you’ve uploaded from the local site.
Note, that you’ll have to add widgets and assign menus to their locations after this kind of migrating the site.
Method 2. Use Duplicator plugin to move WordPress
Duplicator is a free WordPress plugin for creating backups, cloning and migrating sites. It’s got 4,9 of 5 stars and was uploaded more than 400 000 times. So, as you see, it’s worth your attention.
One thing you have to note that you don’t have to install WordPress to the live site beforehand. The plugin will copy everything for you.
1. Pack the site
Install the plugin from WordPress repository and activate after the installation.
Go to the Duplicator -> Packages in your admin area. You’ll see such a blank window in case you’ve just installed the plugin.
The final package will include archive of the site and installer for automatic setup process. To create a package clik on ‘Create New’ and follow the instructions.
In the Setup tab you’ll be able to see, whether your local site meets the requirements of the plugin, name the package, some notes to tell you more information on the package. Storage, Archive and Installer settings you may leave set buy default.
In the Scan tab you’ll see the results of the scanning your file system. On the screenshot you may see that I’ve got notification about the large total size of the site files (they have to be up to 150MB). Click ‘Build’ to proceed to package creation itself.
Build tab displays the process of packaging and after it’s finished you’ll get information of the completed package and you’ll have to download both Installer and Archive.
2. Import the package via FTP
To install the site you’ll have to transfer the Installer and Archive to the live site directory via FTP.
Use any FTP service (like FileZilla) to place these two files to the public_html folder.
3. Install to the live server
Now you’ll have to install the package with the installer.
Add the /installer.php at the end of your domain name and you’ll get the WordPress Duplicator interface. There you’ll have to type the existing access details in case you’re replacing an existing site. Before you proceed to the installation make sure that your connection is fine by clicking ‘Test Connection’. Also, put the check mark at the ‘I have read all warnings & notices’.
You may also create new Admin account for the database just click ‘New Admin Account…’ and type new username and password to the corresponding fields. Make sure that both old and new details of your sites are correct and ‘Run Update’.
Important final steps will remind you how to finish the import properly. Install Report will notify you whether there were any errors while import. Save Permalinks to rewrite rules in the .htaccess
file. Test Site to validate all the pages, links, posts of the site. File Cleanup will remove all the installation files and archives from the live site.
Now you have the live site that is a complete copy of the local one.
Method 3. Export & import database
This is the most preferable way to Move WordPress Site. You may find recommendations on the WordPress official site. This process includes copying of the database from the local server, modifying it to get correct paths and uploading the content to the live server.
However there are at least 3 possible variants to do that.
You may find the first one at the Method 2 of Wpexplorer post. There you just have to find and replace the URLs from the local site to the new live domain name.
The second variant is described in Wpbeginner post. There you have to modify the database paths after importing it to the live site.
And the third variant is to transfer the database after creating and modifying its paths on local server. Here is how we’d recommend you to do that.
Go to phpMyAdin and make export of your local site database. Just click ‘Export’ in the top menu and upload database.sql file.
Then create a new clean database (that will be importe../move-wordpress-from-local-to-live-server/d to your live site in future.css) - just type the name in the corresponding field and click ‘Create’. After that you’ll have to import ../move-wordpress-from-local-to-live-server/the database_ exported from your local site. Go to the new clean database and click __8216.css;Importâ../move-wordpress-from-local-to-live-server/€™ in the top menu. Select the _.sql file_ leave the default settings and click __8216.css;Go’ to import.
After the successful import, ../move-wordpress-from-local-to-live-server/go to the SQL tab and execute the following command. Remember to replace __8216.css;http://old_domain’ with your old URL, and ‘http://new_domain’ with the URL of the new live site:
UPDATE wp_options SET option_value = replace(option_value, 'http://old_domain', 'http://new_domain') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://old_domain','http://new_domain');
UPDATE wp_posts SET post_content = replace(post_content, 'http://old_domain', 'http://new_domain');
After that do the Export of this database.
Then you’ll have to transfer all your WordPress files to the new live domain and change the database name (username and password if needed) in the wp-config.php
file of the WrdPress installation on the live site.
Use phpMyAdmin to Import ../move-wordpress-from-local-to-live-server/the database with replaced URLs. Then login to your live site_ go to Settings -_gt.css; Permalinks and just save them. This will apply the URL changes that you’ve done to the transferred database.
That’s all for now. Here you have 5 possible variants on how to move WordPress site from local to live server.
Do you have any other variants to transfer the site? Tell us in comments. Share the experience and use the best technologies yet existing.
You may read more about Moving WordPress on the official site. Method 1 was taken from Wpexplorer blog. Method 2 on moving the site with the help of Duplicator plugin was originally found on Wpmudev site.