Skip to main content

How can I backup home directory and database in sync?

Comments

3 comments

  • rpvw
    If your website application has a 'maintenance mode' that you can switch to, that tells users that the site is temporarily off-line - use that - or set up a temporary htaccess redirect to redirect everything to a simple html 'off-line' page. Either should ensure no user can log in and upload files via the website application. A user logging into their cPanel or FTP and uploading whilst you are performing the backup may give rise to the situation you describe, and I really don't know if there is any easy way of ensuring that this cannot happen. Conventional advice is to take backups at a time when no-one would likely be doing anything, but with sites serving a global market, this isn't always possible. If cPanel doesn't lock everything during a backup, perhaps a feature request would be in order.
    0
  • MrCanada
    If your website application has a 'maintenance mode' that you can switch to, that tells users that the site is temporarily off-line - use that - or set up a temporary htaccess redirect to redirect everything to a simple html 'off-line' page. Either should ensure no user can log in and upload files via the website application. A user logging into their cPanel or FTP and uploading whilst you are performing the backup may give rise to the situation you describe, and I really don't know if there is any easy way of ensuring that this cannot happen. Conventional advice is to take backups at a time when no-one would likely be doing anything, but with sites serving a global market, this isn't always possible. If cPanel doesn't lock everything during a backup, perhaps a feature request would be in order.

    Temporary .htaccess redirect to prevent anyone from uploading during the backup. Didn't even think about that. Thanks!
    0
  • cPanelMichael
    Temporary .htaccess redirect to prevent anyone from uploading during the backup. Didn't even think about that. Thanks!

    Hello, I'm glad to see that solution works. Note to answer your original question, the website files and MySQL databases are backed up separately during the backup process, so it is possible the data might not be synced if new files are added in time frame between the backup of the website files and databases. Thank you.
    0

Please sign in to leave a comment.