Backing up and Restoring a MYSQL Database.

  WordPress

Your WP site need core files (mostly .php files) and a database (.sql file) in order to function correctly.

WordPress strongly suggests that you make a backup of your site core files and database (.sql) each time a major change is made to your site.

You should always have backup copy of core files and database (sql) file stored on your computers hard drive in case of WP failure, unintended changes or security breach of your site.

Backing up your WP core files is easy. Just connect to the site with an ftp program like Filezilla and download them. Store them in a folder on your hard drive.

Backing up your database via phpMyAdmin is even easier, instructions below.

phpMyAdmin is a web based control panel for managing databases. You can access phpMyAdmin by logging in with your database username and password at https://mysql.webhero.com.

If you do not know your database username and password, simply connect to your site via FTP (Filezilla) and open the wp-config.php file. This is the file that connects your WP core files to your database which is stored in phpMyAdmin at https://mysql.webhero.com.

This is what your wp-config.php file looks like.

wp-config

 

Use the database username and the database password to log in at http://mysql.webhero.com.

 

phpmyadmin-1

One you have logged in, click on databases at the top of the page.

phpmyadmin-2

Then look for the database you wish to backup. There may be a list of databases but in this example there is only one. You will want to view all tables of the database, to do this, click where the red arrow indicates.

phpmyadmin-3

You will now see all of your database tables. Click on “Check All” then select “Export” from the drop-down menu to the right.

phpmyadmin-4

Selecting “Export” will redirect you to another page. From there, do not select anything, simply click “Go.”

phpmyadmin-5

Your database will be downloaded as an sql file. In this example, the file will be called “databasename_com.sql.’

You’ll want to save that file on your computers hard drive.

If you want to import your database, you will first need to drop all the tables.

Log in to phpMyAdmin at https://mysql.webhero.com and click on “Databases.”

phpmyadmin-2

Select the database that you want to work with by selecting it.

phpmyadmin-3

Click on “Check All” then select “Drop” from the drop-down menu on the right.

phpmyadmin-6

Confirm that you want to drop all of your tables. This will empty your database. Only do this if you are sure you have backed up your database.

To import a database.

Browse to your database by Logging in at https://mysql.webhero.com. Click on Databases and select your database name. Click on the Import button at the top of the page and use the “Choose File” button to locate your .sql file located on your computers hard drive. Once you have located the .sql file, click “Go” at the bottom of the page.

phpmyadmin-8

Your backed up database (.sql) file has been imported.

phpmyadmin-9