WordPress is widely used in current web site building. And backup is very important. This article will show you how to restore a WordPress website from a previous backup file.
- Login to your WordPress website admin console. And download the latest website backup file. I use BackWPup wordpress plugin to create website daily backup.
- After download, extract the zip file to a local folder. And then copy all the files in the folder to your local website root folder. My local website folder is
C:\xampp\htdocs\wordpress
.
- Please note the highlighted file in above picture. backwpup_13910f01_twothrp0_ss_dbnamedcb.sql. This file is the website database backup file. From the file name, we can see the database name is twothrp0_ss_dbnamedcb.
- Open a mysql admin manager, i use SQLyog community version. Right click left panel, click ” Create Database” menu to create database twothrp0_ss_dbnamedcb in it. Please Note the database charset should choose utf8 and database collation choose utf8_bin.
- Right click the database name, click ” Import —> Execute SQL scripts… ” to select above database backup sql file to execute.
- When execution complete, press F5 to refresh left panel tree, you can see all bakcup tables and data has been added in the database.
- Right click wp_uhau_options table, click ” Open Table ” in popup menu list. And change siteurl and home column value to your local url in right panel like below picture. My local siteurl and home value is
http://localhost/wordpress/
. Do not forget click the blue soft disk icon in table data list top tool bar to save your update.
- Open wp-config.php file which saved in your local website root folder like
C:\xampp\htdocs\wordpress
in a text file editor. Get the database user name and password from the file.
- Create a user account with above username and password in mysql server use SQLYog. Do not forget assign all previleges for operating database twothrp0_ss_dbnamedcb to the user.
- Now open a web browser, browse url http://localhost/wordpress/wp-admin and login to admin console. If you see below error message that means the database user privileges is not granted correctly. You should change the user Host to localhost and restart mysql server in xampp to make it take effect.
Error establishing a database connection
- Click ” Settings —> General ” menu in left panel, do not edit any field, just click ” Save Changes ” button to save it.
- Click ” Settings —> Permalink ” menu in left panel, also do not edit any field, just click ” Save Changes ” button to save it.
You can also change plugins or check wordpress update in the admin console.
- Now the restore process compele successfully. Logout admin console, browse url http://localhost/wordpress/, you can find your local website execute normally.