WordPress migration from Arvixe to MochaHost

Below are some tips on migrating WordPress from one web host to another. My experience is with migrating from Arvixe to MochaHost, but the steps mentioned should be similar on other shared web hosting accounts.


Back up WordPress database

  • On cPanel, click on phpMyAdmin
  • Select the WordPress database, then Export
  • Select check box Custom – display all possible options
  • Make sure all tables are selected
  • Make sure check box Save output to a file is checked
  • Scroll to the bottom and click on Go
  • A .sql file will be produced, save it to your hard drive
WordPress database back upWordPress database back up

Back up WordPress files

  • Connect via ftp to your web host
  • Copy all WordPress files to your local drive
  • If you are not sure where the WordPress files are located, access the WordPress icon in cPanel, click on Edit, the pencil icon, of your WordPress installation.
  • The Directory field shows where the WordPress files are located
WordPress File LocationWordPress File Location

Install a new WordPress instance on the new web host

Note: If this step is skipped and the files are copied to the new server directly, the backup feature of Softaculous will not be available.

  • On cPanel of the new web host, click on WordPress. This should be in the SOFTACULOUS APPS INSTALLER section.
  • Click on Install Now
  • Fill in the appropriate fields.
  • It is recommended to keep Table Prefix the same as the old database to avoid having to rename tables
  • Make a record of Database Name
WordPress Database Name and Table PrefixWordPress Database Name and Table Prefix

Copy old WordPress files to new web host

  • Connect via ftp to your new web host
  • Rename the WordPress folder on new web host, e.g. public_html to public_html__backup
  • Create a folder with the same name as the WordPress folder before it was renamed, e.g. public_html
  • Copy WordPress files from the old web host to this folder

Set up WordPress database on new web host

  • On cPanel of the new web host, click on phpMyAdmin
  • Select the WordPress database, then Operations
  • Copy the database for backup and comparison purpose
  • Click on Import, select the .sql file created earlier, click Go to import the database

Configuration: wp-config.php

  • On cPanel of the new web host, click on File Manager
  • Select the WordPress folder, e.g. public_html
  • Open file wp-config.php
  • Change the following settings to match the new server, replace ??? with values from new web host
    (Note: values can be found from the wp-config.php file in the backup folder, e.g. public_html__backup)

That should be it, WordPress is now successfully transferred to the new web host.

AddToAny email button not working on WordPress

The AddToAny WordPress plug-in is a great tool, makes it very easy to share any web page on your website.

The email button can be problematic though. In some cases only a blank page is opened, and the error message “Please copy & paste if the app did not open:” shows up.

To work around this problem I recommend turning on the “Universal Email Button” feature of AddToAny. This will bring up a menu that allows the suer to select “Google Gmail”, “Outlook.com”, “Yahoo Mail” etc.

First, visit the AddToAny settings page on the WordPress Dashboard (Settings > AddToAny).

AddToAny settingsAddToAny settings

Scroll down to the “Additional JavaScript” section, expand it, and enter in the following code:

var a2a_config = a2a_config || {};
a2a_config.menu_type = "mail";

Click on “Save Changes” at the bottom to save the changes made.

From now on the “plus” button will bring up the email selection options.

AddToAny email optionsAddToAny email options

Best way to modify WordPress theme

Do not modify the template files directly (Appearance > Editor). If you update or upgrade the selected theme, all your changes will disappear.

Use child theme instead.

To start using child theme

Step 1: Create a child theme folder

  1. Create a folder for the child theme in folder wp-content\themes\
  2. Name the child theme folder with suffix -child
  3. For example, if parent theme folder is twentysixteen, the child theme folder should be twentysixteen-child

Step 2: Create a style.css file

  1. Within the child theme folder, create style.css
  2. Copy the style sheet header below, customize it, and add it to the top of style.css

    Important: The Template field must match the folder name of the parent theme
    Note: The mandatory fields are Theme Name and Template, the rest is optional
  3. Add style rules below the header

Step 3: Create a functions.php file

  1. Within the child theme folder, create functions.php
  2. Copy the code below

Step 4: Activate the child theme

  1. Under Appearance > Themes, the new child theme should show up now
    Hint: Add screenshot.png in the child theme folder to display a thumbnail for the child theme
  2. Click “Activate” to start using the child theme

Modify other files such as header and footer

All files within the theme folder can be modified. Examples:

Header section: header.php

Footer section: footer.php

Single post content section: template-parts/content-single.php

Make a copy from the parent theme folder and save it into the child theme folder. If a file does not exist, the parent file will be used.