After you have set up your own virtual server (VPS) or dedicated Linux server and intend to store important information on the server, you may experience or fear that your data will be lost due to technical problems.
Due to the nature of virtual servers and the importance of information security, most virtual server providers do not back up your server by default. You can also get your server from vendors who claim not to have any problems with your information because of Raid 0 or Raid10 and worst of all Raid5 on their servers. But the truth is that hard drives and Raid controllers are also likely to fail, and in this case the data will be lost. The only one who will lose in the meantime is the user because service providers all over the world do not take responsibility for your information (the nature of the services really does not allow such a guarantee for anyone). That’s why we decided to teach you how to backup Linux vps Server in this article.
Table of Contents
How to backup linux vps
Information has a degree of importance for each person. So first you need to categorize your information and determine how important it is for you. Think about how much the organization or company has spent to produce or collect the information, then enter the importance of each piece of data in a chart so you can make the best policy about it. Information can include images, texts, project codes and files, databases, and other information.
We emphasize that if you have sensitive and very important information in your VPS, be sure to try to back up the data yourself. Although you will need another VPS or FTP backup space to make this backup and the costs will be higher, you will be comfortable with securing valuable information that may be the result of your years of activity.
Why should you make a backup?
Information on your server can be deleted for a variety of reasons. This loss of information is much easier than you think. Consider the following scenarios:
– Random execution of the rm -rf command
– Crash the server in Lock Up
– Software and hardware problems on the hard disk server
– Unauthorized entries to the server (server hacking and ransomware infection or hacker deleting information)
– Viruses that you need to reinstall the operating system to get rid of
Reasons why you think you do not need a backup
Before we begin, let us point out three important points on which you may think you do not need to back up:
1. I do not have enough time to make a backup!
The truth is that we are all busy, but thanks to different backup systems, it can be an automated and timed process that can be set up and installed in minutes. Choose how many minutes to install a backup system or the hours of stress and loss of the result of your efforts?
2. My information is protected by RAID10!
RAID is not a backup system. This is an issue that unfortunately will cause irreparable damage to users due to incorrect advertisements of some service companies. The RAID array can also be failed as a single disk. Raid is designed to increase fault tolerance, not backup, so again, RAID is not a backup.
3. I have no place to keep my data backup!
These days, you can get cheap virtual servers for backups. These services, which have a lot of disk space and are also provided by Eldernode as a virtual backup server, can be a good option for storing your backups.
I hope you are convinced that you really need to make a backup. In this post, various methods of backing up information on a virtual server using scripts or using the control panel capabilities are mentioned. We try to put different methods based on different needs in this article.
How to backup linux vps with CDP script
CDP is a script that connects to your server via SSH and backs up the folders or data you specify for it.
CDP, which stands for Continuous Data Protection, is a script written by PHP that does not require a special database. CDP uses Json to store information, which uses the least resources. (mysql as a database server will need more resources to run). Installing this script is very simple and has the following capabilities and advantages:
1. Web Management Panel
– Add server
– Add backup task
– View backups
– Download backups
– Restore backups
– Clear backups
2. Json Flat data storage (without the need for mysql)
3. Perform backups by Cron (hourly – daily – weekly – monthly and any other type you specify for the interval between backups)
4. Connection to the desired server by password or SSH key
5. Send notifications via email
6. Get an upgrade from cPanel hosting accounts
7. Ability to backup MySQL databases
8. Encrypted backup
9. Back up OpenVz Nodes
How to install CDP script on Linux
CDP script is supported on CentOS / Debian / Ubuntu Linux.
To install the cdp script, you need to connect to the vps that you provided for backup from other Linux servers and enter the following commands in order:
yum install wget nano && wget cdp.me/install.sh && chmod +x install.sh && ./install.sh
By executing the above command, simply install the cdp on your server and refer to the following address to enter the admin panel:
http://1.2.3.4/index.php
Enter the IP address of your backup server instead of 1.2.3.4.
The default username and password are admin, password:
Username: admin
Password: password
You must also edit the config.php file with the following command to change other settings and specify the time as well as the email settings:
nano /var/www/config.php
Note: We strongly recommend that you change the default password from the User section of the CDP UI.
Conclusion
This tutorial explains in detail the reasons for backing up a Linux virtual server. Then how to install CDP script on Linux and finally How to backup linux vps with CDP script were taught.
How to do an automatic backup on the server?
If you have a CPanel control panel, you can easily set up the backup configuration section through the admin section, ie WHM, which days of the week and even during the month, backups will be done for you. Set what time of the day the backup is done and if you have a separate space for backup, you can set it so that after taking the backups, it will be automatically transferred to that space by the control panel and on the server. Do not save so that your server space is not filled with daily or weekly or monthly backups.
If you are one of the users who use the direct admin control panel, you can set this in the backup / transfer or backup manager section. And for other control panels, this can be configured in the section called Backup.
How to restore the database?
If you want to upload a relatively large database to your server, you may not be able to do this from the phpmyadmin section. However, since you have root access to the original server, easily connect to ssh using putty software on Linux servers, and after downloading the backup file via the wget command, restore the database using the following command:
mysql -f -uda_admin -ppassword dbname
How can I upgrade my MySQL version from within whm?
To do this, upgrade to whm via the Software »MySQL / MariaDB section.
How to monitor the server?
In order to monitor the server, you can register at uptimerobot.com. This analyzer checks your server http, Ping, etc. every 5 minutes. It will notify you by email if these services encounter problems.
Is a server with a SATA hard drive suitable for use in hosting services?
Yes, it will not be a problem. But if the number of sites and space consumption is low but the number of site visits is high, the ssd hard drive will be more responsive. This is not usually the case with shared hosting services, and generally sites with less traffic use shared hosting, which is not a problem on the SATA hard drive.