[SOLVED] Restore Downloaded Backups

Discussion in 'General' started by Slimat, Jan 13, 2023.

  1. Slimat

    Slimat Member

    Hi All

    Until a few days ago I was self-hosting ISPConfig with a few websites hosted. As it was self hosted I was able to take a snapshot of the VM image, so in the event that the VM became corrupt I could just restore the last VM image backup to fix things.

    I am now using a remote VPS and it got me thinking about backups incase the VPS becomes corrupt. I already set the websites to make regular backups and I Have read that you can download the backup files. But, I cant find any details anywhere on how to upload a backup into ISPConfig and restore it.

    The scenario I am considering is in the event the VPS dies and I reinstall Ubuntu and ISPConfig... after this how would I restore a website (web & DB) to the new installation in order to restore it?

    I looked in the manual which I paid for when I first started using ISPConfig, but it is for 3.1 and doesnt mention anything (as far as I can see) about restoring downloaded backups.

    Can anyone point me to instructions on how to do this... or offer any advice?

  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The backup is an archive of the website. To restore a downloaded backup, unpack the archive and upload its content into the web folder using FTP or a shell user of the site. If the site contains a database backup too, then you can restore that e.f. using phpmyadmin.

    Website backups are not meant to restore full servers, just to mention it as you mentioned virtual machine backups, which is basically a full server backup. For full server backups, use any Linux backup tool of your choice, e.g. duplicity or when you run multiple servers then something like urBackup.

    Btw. Does your VPS provider not provide snapshot backups?
  3. Slimat

    Slimat Member

    Hi Till

    That makes a lot more sense now... it also explains why I struggled before when I was trying to upload a backup to a vanilla server to try to restore it.
    I guess that for the backup to work the client number / website number, etc will need to be identical to the original installation otherwise any database references may break?

    Yes, they do - for a charge... so I was looking for a way to cover this myself without having to pay regular additional charges... what I may do is to take a snapshot, now its all very nearly working properly, then in the event of a disaster I could restore the snapshot and then upload/extract the data into the /web folder/s & restore the database/s.

    Many thanks
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The backup exists as a file in the filesystem and as a record in the database so that the system knows that it exists, if this does not match, then you can not restore it.
  5. Slimat

    Slimat Member

    Sorry I meant that in the event my installation is irrecoverably lost and I upload & extract the files to the clients web folder... so, if I have recreated the user / web details... as an e.g. if the client was originally client 2 and the website was website 7 - If on the new installation they are client 3 and their website is website 2 - the backup database files may not work because the details are different... or am I over-thinking this?
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    These backups are not meant to be used for a full server recovery at all. They are meant to be used when a single website gets broken (e.g. during a cms update or gets hacked) and in that case, you just click on the restore button so the locally (or remotely stored version, depending on your setup) gets restored automatically. The download option is used only in case you want to move to a different control panel (or your client to a different hosting provider) or as an additional emergency backup on your desktop pc for a manual restore by FTP.

    If you want to back up your whole system, then these backups are not what you would want to use. For such a case, you use a standard Linux server backup software.

    And as I mentioned above, a website backup consists of a backup file and data in the ISPConfig database, so it can be restored automatically only if both exist and match.
  7. Slimat

    Slimat Member

    OK, that make sense... so based on this, there is no real point in downloading the backup files as they cant be uploaded back to ISPConfig and restored.

    Many thanks for all the assistance.
  8. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    not completely true..

    firstly they can by uploaded back to ispconfig servers and restored.. not in the gui, by manual extraction of files and restoring the db using phpmyadmin.
    secondly. you, or your customers, should always have your/their own backup of their website, stored somewhere separately to the live server.
    who knows what might happen... your hosting company might get attacked / close without warning etc.
    you should always have all data in a least 1, preferably more, separate locations, so that even if not going back live with it, the data itself can at least be accessed...

    as server admins we should all be paranoid... multiple backups in multiple locations should be the norm.
    Slimat, ahrasis and till like this.
  9. Slimat

    Slimat Member

    :) Thanks - that was what I interpreted from above, but then doubted myself!

    Completely agree, hence my looking into what options I have - sadly my hosting company don't offer snapshots for unmanaged VPS solutions, but they did send me to an FAQ page on their site showing how to create a whole system backup - they show you how to setup an automated (via cronjob) whole site file backup and also a script to backup your databases. I don't know as much about Ubuntu as I would like, but in case anyone else finds this thread and is looking for something, it might be worth reading this...


    Method #4 is the one to look at - if anyone reads this and can validate whether this will work (obviously moving the backups off the hosted VPS for safety!), then I'd be very grateful to hear. As far as I know, this method should allow a full restore of the site files then restore the databases and you should be up and running.

    Many thank again.
  10. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    not sure i'd go with that. as it's given there, it seems more geared to backing up your home directory.

    it'd suggest looking at the backup script called by the ispconfig_update.sh command, and using that as a starting point.
    that'll cover the essential directories and files eg /etc, /usr/local/ispconfig, the ispconfig db etc. add to that any other essential folders, ie /var/vmail if a mailserver, /var/www if a webserver.

    you could also look at automysqlbackup for regular, scheduled backups of all the databases.

    those combined should cover most of what you need to be able to restore a working ispconfig server. i'm sure i've missed out a couple of directories/files/steps.. but this should be a good starting point to getting a working backup solution.

    another option is to create a disk/partition image, remove the blank/unused space and then save that.

    or you could rsync / from another system over ssh. to a dated folder that uses hardlinks to the previous backup folder.
    you get the whole file system every time, but each dated folder only contains any changed/updated files/folders, anything unchanged is just a pointer back to the original backup of that file/folder.

Share This Page