Backing Up Your Website WordPress or Cpanel

BACKING UP YOUR WEBSITE

One of the most important things that you can do is back up your website. There are 2 different kinds of backups for WordPress. We will discuss the easy way then the more thorough way through your cPanel.

The Easy Way in WordPress

backing up your website wordpress

Go to your dashboard and scroll down to where it says “Tools”. Click on export and export everything. Save the XML file somewhere on your desktop in a folder labeled website backup! You’re done!

NOTE: This way does not back up your media or graphics, only text.

Only cool people share!

Backing up WebSite Thorough cPanel

Go to your cPanel and log in. Scroll down to where it says “Backup Wizard”  and click on it.

backup wizard cpanel

 

Next you will see the following screen. Click on backup again.

back up website in cpanel

Then click on “Full Backup”

full backup cpanel

Next make sure “Home Directory” is selected and enter your email address so you can get a link of the backup in your email. Then click “Generate Backup”

back up cpanel home directory

  • You will see a little message telling you that the backup is in progress and you will receive an email when it is complete. You can then log back into your cPanel and download all your content including:
    • All Media
    • Databases
    • Plugin files
    • Theme Files
    • WordPress Files

It will contain your graphics, database, media and all your files in a zip folder. 🙂

Backing Up Website & Database With Terminal

Backing up your website & database is faster and easier with terminal commands. However, with it being easier it is also easy to screw up. Make sure that you know what you are doing before you do it. Our clients here at a1websitepro.com can make a backup of their website and database as long as you follow these commands.

What Software You Will Need

You will need “Shell” software on your computer. If you have a Mac or Linux it is called “Terminal” and it is already on your computer.  If you have a Windows PC you will have to download “Putty”.

Windows PC Software

If you are running a Windows PC you will have to download the “Putty” software that lets you connect to your website via shell. Please click on this link “Download Putty For Shell Access” for instructions then come back and finish this tutorial.

Instructions For Backing Up Website In Shell Terminal

To backup your website in shell open up your terminal. For Mac or linux go to “Finder” and type in “Terminal” and click on it. Then you will enter your login credentials. Your username and IP address will be different but here is the syntax.

[code]ssh user@123.456.789.321[/code]

It will look something like this.

backing Up Website in Terminal

You will be asked if you want to continue connecting, type in “Yes”.  Next, you will asked for your password. Type in your password whatever that may be. You will not see anything being typed, this is a security feature in shell. Just type your password and press the enter key. Once your are logged in type in the following exactly as I have it if you are on A1WebsitePro server.

[code]cd ../../web[/code]

Back Up Database First

The first thing we are going to backup is the database. To get the username and password for the database we need to see what it is. We can get the information from the wp-config.php file. We can do that by typing in the following.

[code]nano wp-config.php[/code]

Once the file is loaded you can use your “arrow down keys” on your keyboard to scroll down. Navigate down to where it says DB_NAME, DB_USER, DB_PASSWORD. You will need this information to create a backup for your website. It will look something like this.

Database info for terminal Backup

 

Copy all of that information. Do not press shortcut keys on your keyboard. This will mess the process up. Highlight the information, right click, and select copy with your mouse only. Then past it into a notepad or text document.

Now press “control x” to get out of the wp-config.php file. If it asks you if you want to save anything be sure to answer “NO”!

Now that we have the information that we need it is time to backup the database. We do this by using the “mysqldump” command. Here is the syntax, do not use the square brackets [] during this process.

[code]mysqldump -u [username] -p [database name] >[sql file name].sql[/code]

So your syntax would look something like this.

[code]mysqldump -u username -p databasename>data.sql[/code]

After pressing return or enter you will be prompted to enter the password. You will not see anything as you type once again, just make sure that you enter the correct password.

After you enter you password this will make a backup of your database. Type in “ls” to see the list of files.

[code]ls[/code]

You should see “data.sql” in your list of files.

Backing up Everything

Now we want to back up all the files on the server. We do this by typing in the following command.

[code]zip -r backup.zip *[/code]

Next visit your website at https://yourwesite.com/backup.zip and download your backup. After you have downloaded your backup remove the backup from your server so someone does not steal it. So go back to your terminal and type in the following command.

[code]rm backup.zip[/code]

Now you can exit the terminal by typing in exit like this.

[code]exit[/code]

Now you have a backup of your website. 🙂

 

Backing Up Your Website WordPress or Cpanel was last modified: November 24th, 2018 by Maximus Mccullough
Summary
Backing Up Your Website WordPress or Cpanel
Article Name
Backing Up Your Website WordPress or Cpanel
Description
One of the most important things that you can do is back up your website. There are 2 different kinds of backups for WordPress. We will discuss the easy way then the more thorough way through your cPanel.
Author
BACKING-UP-YOUR-WEBSITE

2 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.