Backup, Restore or Migrate a WordPress Website

0
446
cPanel

Backing-up, restoring or migrating a WordPress website from one server to another was never been easier. Newbies ought to think these processes are as simple as one-click button. But, if you’re moving on to a new server or changing the host, you might have to go through a complex process of compressing, downloading and uploading all the stuff, including your FTP files and databases, and then fixing any coding issues that might result into post-restore errors.

Step # 1: Backup the Website

Backing up is the process of creating an identical copy of the files stored on your File Transfer Protocol (FTP) account and the MySQL database in the case of website migration to a different host or server, or to prevent data loss in case of website hack or technical issues.

A. Backup the Files

1. Open the cPanel.

2. Click on File Manager under the Files section.

File-Manager3. Expand the following:

  • /home/public_html

public-html-folder

4. Click Select All in the right-side panel.

Select-All

5. Right-click the selection, choose Compress.

Compress

6. Select the Zip Archive as your compression format.

7. Click Compress Files.

Zip-Archive

8. After successfully compressing the files, right-click the compressed file, and choose Download.

Download

B. Backup the Database

1. Log-in to your cPanel.

2. Click Backup Wizard.

Backup-Wizard

3. Click Backup.

Backup

4. Click MySQL Databases under the Select Partial Backup section.

MySQL-Database

5. Click the Database name displayed in the list corresponding to your website.

6. The download will start automatically.

Step # 2: Delete Duplicates

Scanning for dupes can help lower the bandwidth and save your server space, time and efforts. Do NOT attempt to permanently delete any files associated with your website. Only delete duplicate separately uploaded documents, music, videos, and images not as part of your regular website files.

1. Download a Dupes Finder for your FTP files.

Click here to start Clone Files Checker download.

2. Click Add, select the downloaded files and then click on Start Search.

Clone-Files-Checker

3. After finishing up, you’ll be asked to perform Quick-Fix or Review & Fix. The former deletes duplicates automatically, while the latter lists them out into a window so that you can take individual actions on your files.

Step # 3: Restore the Website

Website restoration is the process of uploading the data from secondary storage device (such as a local hard disk) to your server. It also involves deleting the database, user associated with the website, and then re-creating the same again. You’ll also need to assign necessary privileges to the user.

A. Delete Database & MySQL User

1. Open the cPanel.

2. Click on MySQL Databases.

MySQL-Databases

3. Under Current Databases section, delete the database associated with your website.

Delete-Database

4. Scroll down to the page bottom. Delete the user associated with your website.

Delete-User

B. Create a New User

1. Open the cPanel.

2. Click on the MySQL Databases.

3. Under MySQL Add New User section, specify a User Name and Password. In the case of shared hosting, you may receive an error when the user name is already in use by other websites stored on the shared hosting server.

Add-New-MySQL-User

4. Click Create User.

5. Note down the User Name, Password and Database Name.

C. Link the User to your Database

1. Under cPanel > MySQL Databases, scroll down to the Add User to Database section.

2. Select the newly created User and the corresponding Database you want to link to.

Add-User-To-Database

3. Click Add.

4. Check-up the box All Privileges and then click on Make Changes.

D. Perform Restoration

a. Restore the Files

1. Open the cPanel.

2. Click the File Manager.

3. Select Web Root, and then click Go.

File-Manager-Directory-Selection

4. Expand the following:

  • /home/public_html

5. Click on Upload on the standard toolbar.

Upload

6. Click Choose File.

7. Select the compressed website backup file on your local machine to automatically upload it.

8. After successfully uploading the compressed backup file, extract the file contents.

b. Restore the Database

1. Open the cPanel.

2. Click Backup Wizard.

3. Click on Restore.

Restore

4. Click MySQL Databases.

Select-Restore-Type

5. Click Choose File.

Restore-MySQL-Database

6. Locate the Database file stored on your local machine.

7. Click Upload.

Step # 4: Finalising Set-Up & Troubleshooting Post-Restore Errors

At times, you may encounter different problems. An error may occur saying Error establishing a database connection as soon as you open the website. You may want to check-up the parameters set into the wp-config.php file. Update the host settings such as cPanel user name, server IP address, new domain name into the WordPress configurations file.

WordPress may also fail to upload new images into your posts. This issue can be easily tackled by clearing-up the upload_path text box into your corresponding database.

A. Modify the WP-Config.php File Contents

1. Open the cPanel.

2. Click on File Manager.

3. Open the following:

  • /home/public_html

4. Right-click the wp-config.php file, select Edit.

WpConfig

5. Click on Edit.

6. Scroll down to the following code:

define(‘DB_NAME’, ‘Database_Name_Here‘);

/** MySQL database username */

define(‘DB_USER’, ‘DatabaseUserName‘);

/** MySQL database password */

define(‘DB_PASSWORD’, ‘DatabasePassword‘);

/** MySQL hostname */

define(‘DB_HOST’, ‘localhost‘);

/** Database Charset to use in creating database tables. */

define(‘DB_CHARSET’, ‘utf8‘);

7. Enter appropriate Database Name, corresponding User Name and Password you noted down earlier while creating a new user in MySQL Databases.

8. Make sure that the DB_HOST and DB_CHARSET are set to localhost and utf8 respectively.

9. Click Save Changes.

B. Modify Code Related to Third Party Plugins

  1. Open the cPanel > File Manager.
  2. Open the wp-config.php file.
  3. Make sure that the cPanel user name, server IP Address, new domain name are properly updated. (The actual server IP Address can be found on the top of the left panel in the cPanel.)
  4. Click Save Changes.

C. Clear Default Upload Directory into the Database

1. In the cPanel, go to phpMyAdmin under Databases section.

2. Select the database displayed on your left panel.

3. Expand the wp_options node.

WP-Options

4. Move on to the second page on the right side.

Next

5. Select Edit near the upload_path.

6. Clear the text box contents and then click Go.

Save-Database-Changes

Free Up 10s of GBs of Disk Space!

LEAVE A REPLY