Bluehost WordPress, the backup archive restore process

It has been more than one month since registration in Bluehost WordPress hosting. Bluehost provides relative nice space quota and hardware platform. Although I got some issues struggling with the free SSL problem, the customer services responses swiftly. With the high satisfaction, I decide to extend the package after one money trial. After checking the renewal package, I am surprised that the rate (6.99/m 5yrs) is much higher than initial rate (2.95m 5yrs). To prevent any misunderstanding, I also inquiry with online chat service. Yes, it is true, $6.99/m.

Some people mentions this is negotiable. You need to bargain with customer support multiple times with different personnel. After all that hard work, it still gets about $6.99 (Pro in his example). That is still higher than initial rate. This worries me. To ensure I am capable to move from Bluehost to another hosting service, I decide to do a WordPress backup restore practice.

Note! This article is mainly for restore process verification. Some process doesn’t consider the security issue. All are for simplifying the process. So, if you want to apply to a working site, you need to pay attention on this. Additionally, we use root account throughout the article.

Linux Distribution

Here, we use Ubuntu 16.04 64bits. 14.04 32bits is also ok with some modification due to its old package. For easy operation, 16.04 is chosen. Then, just install Ubuntu on physical or virtual machine.

The backup archive

The backup archive is meant to all things of WordPress. The tough thing is that not all WP hosting service provides complete backup. When I leave WordPress.com, I only get the database backup file. Upload files or and plugins are not included. Maybe someone can get that by contacting their customer support. Since Bluehost provides ssh login, it is no problem to get all things. I backup everything including:

  1. WordPress database dump file,contains articles and settings.
  2. WordPress folder,uploaded files, plugins, themes and apache .htaccess file

If you hosting service provides ssh access, following is the simple steps to backup them.

Backup wordpress database

Database name, user name, password are stored at wp-config.php of wordpress. Just search DB_NAME, DB_USER, DB_PASSWORD.

backup WordPress folder

This is quite simple. Just tar everything with the dumped database file. Then, get it back to your PC by any mean.

Linux WebServer Configuration (Apache2)

No small talk. If you use Ubuntu 16.04, just paste commands as below. (assumed root privilege). It installs apache and php.

Modify Apache config file to allow .htaccess setting override. Edit /etc/apache2/apache2.conf as below. The key is the “AllowOverride”.

Install MySQL Server. During the process, it will prompt for passwords of root. For simple test, just set it as “123456”.

Add Host Name

If you official WordPress site has its own domain name, the verification process may fail in your local machine due to the connection targeted to the domain name.  Or, if you machine is connected to Internet, you may connect to the site online and mislead your to a impress of success. Therefore, we need to apply a local-only domain name to your machine. We can do this by using /etc/hosts on Linux to achieve this. Example with my domain name  (moon-half.info),

Restore WordPress

We already finish the server configuration. The next step is to restore the wordpress backup archive to make it work on local machine. The detailed steps is listed below with some comments. In summary, we extract the backup archive “XXXX.tar.gz” and get a “public_html” folder and wp.sql. Basically, we restore the wp.sql to MySQL and move public_html to /var/www/html. (Also assumed ‘root’ in this operation)

Verifying the Result

In theory, the process is done. To prevent connection to the working site on Internet, I recommend to unplug your network cable to avoid any confusion. Now, you can browse your site inside your Linux box with the original domain name. Due to domain name, connection from outside the Linux can’t connect to that site. If you want to make it work for others, you can change the domain name to IP address in Line 11 of above command table.  Or, set hostname correctly in every machine. Simple purpose simple settings, it should be ok to just verifying in Linux box.

Latest Comments

  1. 蔡可彼 2018-05-20
  2. Www.Casellet.Com 2018-06-26
    • 蔡可彼 2018-07-02

Leave a Reply(Name請以user_開頭,否則會被判定會垃圾息)

請輸入答案 ÷ 3 = 2