Backing up WordPress, MariaDB Database and Setting up CentOS 7

To make a backup of your SQL Database using MariaDB, you have to issue a simple command.

It will ask you to input your database password, and then you should find the database_name.sql in your home directory. Once you’ve backed up the file, you can download it just as you would any other file with SFTP.

Restoring an SQL Database with MariaDB and setting up CentOS 7

The next stage is to set up your new machine. If you’re using a host like bhost, you’ll want to create a temporary SSH from the website’s login panel.

Assuming you already have a web development server at home with ssh keys set up, you can simply update your web server and upload the same folder you use with your home machine:

This prevents people from logging into the machine without the required ssh key file.

You don’t need to restart sshd if you plan to restart the machine immediately afterwards; however, it is wise to know the command:

Next install and start httpd:

Install the firewall, check its state and allow http/https access:

Install MariaDB (it is a mySQL server) and start it:

Setup MariaDB and install php and php-mysql:

Create a file to check php has installed correctly:

Check the file exists:

Unzip a backup of your website:

Log into mysql and restore the database:

You’ll find certain permalinks won’t work:

Install php-gd to also help with permalinks:

Make sure you delete wordpress cache if you used a plugin at the point of backing up your site.

Block spam bots from bad IPs:

Check the time and date, and fix it if is it incorrect:

These commands assume you have already backed up some of your website.

This doesn’t completely set up a system but it gets the basics up and running. Backing up WordPress, a MariaDB Database and Setting up CentOS does not take much time once you know all of the commands. I find WordPress plugins unnecessary.

Leave a Reply

Your email address will not be published. Required fields are marked *