WordPress backup and restore


In this chapter, we will look at how to Backup & Restore Recover files and databases in WordPress. There are two parts of backup in WordPress, such as

  • WordPress Files Backup
  • WordPress Database Backup
  • WordPress Files Restore
  • WordPress Database Restore

WordPress File Backup

To obtain WordPress backup files, you need to install FileZilla Client on your system.

Here are the simple steps for file backup operations in WordPress -

Step (1) - Open the FileZilla client as shown in the screenshot below.

wordpress-backuprestore-step5.jpg

Step (2) - Enter the host, username, password and port you use to log in to cPanel .

wordpress-backuprestore-step6.jpg

After filling in all the fields, click the Quickconnect button.

Step (3) – You will see all the files and folders of your WordPress website on the right side as shown in the screen below.

wordpress-backuprestore-step7.jpg

Step (4) - Select all files and folders, right-click the mouse and click Download.

wordpress-backuprestore-step8.jpg

After you download the WordPress file from cPanel, it will be saved on your system.

WordPress Database Backup

The following are simple steps for database backup in WordPress-

Step (1) - Enter the path in the browser http://localhost/phpmyadmin . You will get the following screen.

wordpress-backuprestore-step1.jpg

Step (2) - Click on the database name "wordpress" you created for WordPress.

wordpress-backuprestore-step2.jpg

Step (3) - After clicking on the database wordpress , the following page will open. Click the Export tag.

wordpress-backuprestore-step3.jpg

Step (4) - You will get two methods to export the database, namely Quick and Custom . Select any method and click the Go button.

wordpress-backuprestore-step4.jpg

After exporting the database file, it will be saved on your system.

Restore WordPress Files

Here are the simple steps to restore files in WordPress using ftp -

Step (1) - Open FileZilla Client and log into your website using ftp as shown in the screen below.

wordpress-backuprestore-step9.jpg

Step (2) - Open the local directory in ftp and upload all WordPress files to your website as shown below.

wordpress-backuprestore-step10.jpg

Step (3) - Then, find your wordpress folder → wp-config.php file. Copy and rename the wp-config.php file before editing, you can restore this file if there are some errors.
Open the wp-config.php file and find the following code.

define('DB_NAME', 'db_name');

Replace db_name with the name of the database you created.

define('DB_USER', 'db_user');

Replace db_user with your username MySql.

define('DB_PASSWORD', 'db_password');

Replace db_password with your password MySql.

Save your wp configuration file after editing and upload to your WordPress website via ftp.

Restore WordPress Database

Here are the steps for restoring the database in WordPress-

Step (1) - Enter the path in the browser http://localhost/phpmyadmin . The following screen will pop up.

wordpress-backuprestore-step11.jpg

You can create a new database or import a backup in an existing database.

Here we will create a new database name which is new_wordpress and click on the new_wordpress button.

Step (2) - You can view the database you created as shown in the screen below. Click on the database name new_wordpress .

wordpress-backuprestore-step12.jpg

Step (3) - Click Import.

wordpress-backuprestore-step13.jpg

Step (4) - Click the Select File button to select the backup file from the system. After uploading the sql file, select the format as SQL as shown in the following screen.

wordpress-backuprestore-step14.jpg

Click the Go button.

Step (5) - Once you click Go, you will receive a message after the sql file has been uploaded successfully.

wordpress-backuprestore-step15.jpg