Create private backup of your web site

By | September 18, 2021

Everything may happen, but being wise after the event sometime is not a good choice.
On Saturday 28 August 2021 incident happened the data on servers of my Webhosting provider were wiped, some backups were destroyed also on many server machines. You can read more about this here . Most likely it was a Ransom attack, although the release of the hosting company said that NO. Time by time I am making my own backup of my sites and it helped my to restore my content rather quickly without waiting for provider recovery result. To create own backup is simple what you need to copy all important files from server to your local storage plus export databases, if your site is using them. I prefer to use ftp to download files from the server. Usually Web hosting providers support file transfer protocol. The first you need to create ftp account if you do not have any. If you are using cPanel go to “FTP Accounts” and create one:
Create FTP Account
If you want to have access to all content of your hosting folder leave Directory text box empty.
Now if you are on Windows open File Explorer and specify in address box name of your ftp server, the login dialog should popup. After successful login you will see content of your files on Web server:
File Explorer FTP connection
Select files or folders you need, copy them and paste into local folder. In most cases fro simple sites it is enough to copy public_html folder, however if your server scripts are saving something outside of public_html you need to copy these files or folders too. Also copy mail folder if you want to keep local copies of your emails.
Also you can download your Web content using CLI wget command:

# wget --user -&#x2dpassword some_password -r

Do not forget option -r to recursive download.

Databases. If you site is using databases you need to backup them too. In cPanel go to phpAdmin, select some database on the left, click on Export, select Format (usually SQL by default and it is OK) and click Go.
Export database
The database image file should be downloaded on your local drive and usually saved in Download directory.
The local image of your website may be used not only as backup but also if your want to migrate somewhere else, for example to change Web hosing company.
You can also use FTP to upload a local copy of a site to the empty content of a new web host, but in reverse order: copying local files and folders on your computer and pasting them into server folders. You can use phpAdmin with the “Import” option to load database images. But about this in detail sometime later, maybe.

Leave a Reply

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