How to move from offline to online WordPress

December 20, 2014 Posted by WithU Technologies , ,

Move from Offline to Online WordPress



What is WordPress?


WordPress is web software you can use to create a beautiful website or blog. We like to say that WordPress is both free and priceless at the same time.

WordPress is the most recommended way of blogging (we are talking about the self-hosted version) as it is free and also easy to use. We can download several plugins and themes on it to customise our site

In our previous post, we learn the process to setup a database for WordPress and also learn to install it in the WampServer which helps to create your blog without having any Internet connection.

But now if your blog is ready to publish and posts are also updated, then you need this article to migrate your whole offline WordPress setup to a new online environment.

And for that you have to follow certain steps which are covered in this article. By using this process, you would be able to migrate all of your content (posts, pages, images, etc.), themes, as well as plugins from local server to a newly created website.

This articles also explore the steps to setup your website with a self-hosted platform and domain.

To make this moving process is easier you can also use two useful plugins:

  • BackupBuddy

  • Duplicator

In this article we will show you the process of moving your WordPress from offline local server to a online live site manually.

Assumptions



  1. You have WordPress setup with a database installed on your local server such as WampServer. (If not then click on our previous post links to learn that)

  2. You have full access to that such as the Username, Password etc.

  3. You have your hosting service and Domain name which you own. (For more information in Hosting, Domain setup- )

Step 1. – Exporting the local WordPress database


Now you need to export your local WordPress database.WampServer features the phpMyAdmin function ability. We will be using phpMyAdmin to do that. PhpMyAdmin is a web development application which manage MySQL databases.

  • If your WampServer is not running, then launch it by double clicking on the Desktop shortcut for WampServer

You can find out the launching process by peeking at your quick launch icons.

Launched





php

  • Now left click on the WampServer green icon, which is on the taskbar or it may be on your quick launch window.

  • Then click on phpMyAdmin. A new offline page will be opened on you default browser.

Or

Go to http://localhost/phpmyadmin/

Databases

  • Click on your WordPress database.

Export

  • Click on the Export button from the top menu bar.

  • Click on Custom – display all possible options. (It will provide you more options to Export your database)

  • Select the WordPress database or just select all if you wouldn’t create any other databases.

gzipped compression

  • Select gzipped in the compression segment under Output.

  • Leave all the other options as they are.

go

  • Click on Go.

  • A Zip file of the database will be created and ready to be download.

  • Download the file on your desktop. (These file is used during the Step 6. below)

Step 2. - Uploading local WordPress files to the self-hosted site via FTP client


File Transfer Protocol (FTP) is a fast and simple way to transfer the local files from one computer to another computer or say Server over the internet. In simple words, it is the way by which you send your files from your computer to your web hosting server.

Here are some FTP clients, which you can download and install on your computer to upload the local WordPress files to your server.



  • WinSCP (Windows Only)

  • Cyberduck (Mac Only)

  • FireFTP (All Platform)

  • Filezilla (All Platform)



  • Install the FTP client software in your computer.

  • Connect with the server by providing their host name and username and password.

upload

  • After connection takes place, upload the files to the right directory.

Generally it will be the public_html directory on your live site where you upload all the local WordPress files. (In case of WampServer the files will needed to be stored on www folder inside the wamp directory.)



  1. Now select your local WordPress files and upload them to your live server.

Step 3. -Create MySQL database to you self-hosted live server using cPanel


Most hosting service providers features cPanel with their service which is acts as the main tool for managing your web database.

MySQL database

  • Login to your cPanel and click on MySQL Databases in the Databases section.

create database

  • Create a new database with a name.

  • Then Scroll down to MySQL Users section and create or add an existing user to the database. After adding the user, cPanel will take you to set MySQL privileges for that user.

  • Grant all privileges to the user.

Step 4. – Importing your WordPress database to your self-hosted site


Now, the database which contains all the information and data which you created in your offline WordPress.

  • Get back to your cPanel Main.

phpMyAdmin

  • Click on phpMyAdmin under the Database section. This will take you to phpMyAdmin page.

Databases

  • Click on the Database in the top menu.

  • Click on the database which you created earlier from the list.

import database

  • Click on the import button in the top menu.

  • Click on Browse button and select the gzipped file which was downloaded earlier during the Step 1.


  • Press the Go button at the bottom of the page. phpMyadmin will now import your offline WordPress database with all its data and contents.

Step 5. – Correcting your website URL


Now, as your website was setup on an offline server earlier, the URL for that also used to be for a offline site. So you have to change that URL into your new domain name which you brought earlier to setup your live WordPress site.

  • Get back to the phpMyAdmin database and select the database for WordPress.

wp Option

  • Now, in your phpMyAdmin, look for the wp_options table in your database. (If you changed your database prefix, then instead of wp_options it might be {prefix} _options)

  • Click on the Browse button on the side bar and it will redirects you to the files inside it.

siteURL

  • Select the Edit option for the siteurl file under wp_options table. An edit field window will appear.

  • Now, look for the input box for option_value, you will see the URL of your local server installation, probably something like: http://localhost/wordpress.

option value

Carefully insert your new site url in this field, for example: http://www.demodifier.com

  • Save the new URL by clicking Go button.

  • Get back to the files stored under wp_options.

home option

  • Search for home option or file. (Usually it is on the second page which you can navigate to by clicking on the pagination arrows in phpMyAdmin)

  • Update the home url to be the same as your siteurl. (Replicate the steps use for siteurl option)

Step 6. - Merging of live WordPress database with the User database


Now we have to configure wordpress and merge all of our content with the wordpress database. To do this you have to edit the wp_config.php file either from the cPanel File manager section under the Files menu or by using a FTP client.

As the process to connect with FTP client and uploading files were already shown in Step 2., that’s why we are showing the alternate method.

Editing wp_config.php file from the cPanel File manager section under the Files menu

  • Go to cPanel- Main

files

  • Click on File manager under Files section.

public_html

  • Navigate to the public_html directory.

  • Right click on wp_config.php file and from the option popup, click edit. (It will redirects you to the code editing page)

  • Edit the followings:

  • /** The name of the database for WordPress */

define('DB_NAME', ‘__________’);



  • /** MySQL database username */

define('DB_USER',’ __________ ’);

  • /** MySQL database password */

define('DB_PASSWORD', '________');

Provide the database name, user and password you created earlier in Step 3. Save the wp-config.php file and upload it back to your server. Visit your website, and it should be live now.

Save

  • Now log into your WordPress admin panel normally or by this web address:

http://www.mysite.com/wp-admin/options-general.php (change the domain name to your own domain name)

  • Go to settings and click on General. Scroll down and click on save. (This will automatically corrected the site url everywhere it needs to be)

  • Go to settings and Click on Permalinks. Scroll down and click on save. (This will automatically corrected all the post links everywhere it needs to be)


Step 7. - Updating path links to fix the images and broken links


During website migration or whenever you are moving a WordPress site from one domain to another domain, or from local server to a live server, you would face problems with broken links and missing images.

This process can be completed by two methods:

  • By using WordPress plugin: Velvet Blues WordPress plugin.

  • By using a simple SQL query.

The steps for SQL query method:

  • Go to phpMyAdmin from cPanel.

Databases

  • Click on Databases from top menu and click on your database.

Sql window

sql query code

  • Click on SQL from the top menu. Write this query in the input box and click Go (Don’t forget to change it with your own local site and live website URLs)

So, the process is completed J

Hopefully we are able to make your work done and your site will be up and running by now. Surf your site and test all the links and images to ensure that everything is running well and fine as expected.

Still if you have any problem, Questions or troubleshooting then feel free to ask below in the comment section and we will be happy if we can help.