blog posts

How to Backup of Windows and Linux virtual server

Among the most important things that should be paid special attention to in the virtual server is taking a backup of the virtual server; Important information that any organization, company, or even private sector has in its virtual server may be suddenly lost or deleted during processes, at this time, by preparing a backup copy of the virtual server, you will be able to restore the desired files. Re-upload to the server.

If you are one of the people who keep files or important things on the server, taking a backup on the virtual server should be one of your priorities; with the loss of your site data, your site may be unavailable forever, So backup is considered important and necessary…

In this article, we have tried to tell you the simplest backup methods of Windows and Linux virtual servers so that you can have a backup copy of your virtual server anytime.

Reasons for backing up from a virtual server

The existence of unforeseen cases such as:

  • Hackers and malware
  • Human errors and server error

Various factors cause the loss of the server’s database, which can have many risks for the website and even cause us to lose essential files; Among the main cases, the intervention of hackers and malware or human errors and even server errors can be mentioned.

In simpler terms, suppose your server has antivirus and a firewall, and you think you are safe in every way; this negligence creates many openings for hackers to gain access to your site through various methods. At this time, if you do not have a backup copy of your server, you may easily lose your files.

Or the existence of human errors and errors in the server, such as failed updates or accidental deletion of some files that cause you to lose the original files and essential items. As a result, always have a backup or a backup copy of the files on the server. You can access the desired information and files at any time.

Backup from Windows virtual server

To make a backup copy of the Windows Server, it is necessary to install the Windows Server Backup service; So follow the steps below to access the desired service;

First, run Server Manager as shown in the following image:

Next, choose option number two: Add roles and features:

Now continue the relevant steps to the Features section and click on the Next option; After reaching the relevant section, find the term Windows Server Backup and select the corresponding tick; Then click on the Next option:

After confirming the process and starting the installation, click on the Install option:

When the installation is complete, click Close and restart the server:

 

Start backup on Windows Server

Run the Windows Server Backup service and then click on the Local Backup option, then click on the Backup Schedule option:

In the first section, click on the Next option:

Now specify the type of backup; If you want to back up all Windows information, choose the first option, and if you want to back up only one directory, choose the second option, and then click on the Next option:

In the next section, set the backup time and then click Next to continue:

In this section, you will have three options;

1. Choose the first option if you have two hard drives and want the system backup to be stored on your second hard drive.

2. If you want to save the backup on the server’s main hard drive, choose the second option.

3. In this section, if you have a web or network storage space, it is recommended to use this option.

Choose one of the available options according to your choice and then click on the Next option:

Select the desired path to save the backup and then click on the Next option:

Finally, click on the Finish option to save the applied settings:

Now your automatic backup has been saved successfully, and the backup will be done at the time you have registered; Click on the Close option to close the desired window:

 

Backup from Linux virtual server

Run the desired server and then use the following command; note that after running the command, the backup of the Linux server will be done automatically:

tar -cvpzf yourbackupfilename.tar.gz --exclude=/path/to/backup/yourbackupfilename.tar.gz --one-file-system /

Note: In the desired command, you can change the name of the backed-up file instead of the section: yourbackupfilename;

The output of the desired command will be by the image you see.

 

In the meantime, a question may have occupied your mind; How to download the backup file from the Linux server? 🤔

Using WinSCP software

WinSCP

What is WinSCP used for?

According to WinSCP.net: SCP Software is a free, open-source SFTP client, FTP client, WebDAV client, S3 client, and SCP client for Windows; Its main function is to transfer files between a local and a remote computer. Beyond this, WinSCP provides scripting and native Linux file management;

In a simpler and more diverse introduction, WinSCP is software that transfers data or dodownloadsequired files from a Linux VPS to a computer or main system.

To check and use WinSCP software, you can go to the desired link under the title: Download WinSCP software; Have the necessary access.

Download the backup file from the Linux server

Run the software and then enter the desired Linux server;
Right-click on the desired zip file from the backup file and select the Download option:

Common mistakes in VPS backup

Common mistakes in backup make the backup process on the server completely pointless; if you do not pay enough attention to the things mentioned, you may lose the server backup file; So don’t forget to observe the following points during the backup process:

Updated backup versions

If you also have an activity on your server that creates new files every few days, then you need to perform the backup every three days; Observing regular backup will allow you to have any file from the server you want.

Naming server backup versions

You may need to access the backup of the desired file during the backups you prepare during the work; In the meantime, if the file you are looking for does not have a specific name, it may be confused with the rest of the backup copies, so prioritize the naming of each backed up file.

Backup storage on the main server

Definitely and strictly avoid saving the server backup file in the main location of the desired server and store the files in another part other than the main location of the server; suppose your server goes down or there is a problem with the server. You can’t access the backup file of the server.