SIGN IN / UP
    opened image

    ​Backups on VestaCP/HestiaCP servers via mount

    During the VestaCP/HestiaCP backup process, a situation arises when the available disk space is limited. To solve this situation, you can use the backup method via mount, which allows you to backup to the mounted folder of the new server using the SSH protocol. This approach is especially useful if the old server is also running VestaCP/HestiaCP and there is not enough free space to create a backup. In addition, you can backup immediately to a new server using the VestaCP/HestiaCP control panel, if you previously mount the folder on the new server. It's important to note that the mount point should be /home/backup or /backup because that's where backups are stored.

    The process of mounting a folder from a new server

    To mount a folder from the new server as a repository on the old server, follow these steps:

    1.      Login to the old server through the console.
    2.      Enter commands to mount the /home/backup or /backup folder from the new server.

    To mount a folder from the new server as a repository on the old server, you must run the sshfs command and specify the appropriate options. After completing the backup process and transferring the backup, it is important to unmount the folder of the new server in order to prevent repeated backups to the new server.

    sshfs -o allow_other USER@IP:/home/backup/ /home/backup/ -o nonempty

    Where in USER@IP : USER is the user on the new server, IP is the IP address of the new server.

    If the system reports that the sshfs command was not found, run the following command to install (for CentOS, or Ubuntu/Debian):

    yum install -y sshfs
    apt install sshfs

     

    Then re-run the command on the folder mounter on the remote server:

    The backup process will now run on the old server and be saved to the /home/backup or /backup folder on the new server.

    After the backup is completed, the control panel will display information about the archive size and execution time. For example, sites that take up 25 GB can be migrated and archived in one hour. If the sites have a large number of small files, the process of archiving and transferring data will take longer.

    Mounting on a server with cPanel, ISPmanager or without a panel

    If the new server uses ISPmanager or the control panel is not installed at all, follow these steps:

    sshfs -o allow_other USER@IP:/var/www/USER/data /home/backup/ -o nonempty

    Where in USER@IP : USER is the user on the new server, IP is the IP address of the new server.

    Checking Mount Points and Freeing Up Space

    To check the mount points and available free space on the new server's mount folder, run the following command:

    df-h

    Unmounting a folder

    After completing the backup process and transferring the backup, you need to unmount the folder of the new server so that the old server does not perform daily backups to the new server. To unmount the new server folder, use one of the following commands:

    umount /home/backup/

    or

    umount -v /home/backup/

     

    Results.

    Backing up a site on servers with VestaCP/HestiaCP panels, using the backup method via mount, is useful when the old server runs out of free space and data transfer is needed. And this will help you backup the site and transfer data in one step.