Backup the entire website from the admin side. with or withour cronjob

eric redegeld Posted in Component Development 5 years ago

Hi is there an option from the admin side to quicy make an backup for the entire site
free or paid

Thanks
Eric

Replies
us Rishi B Replied 5 years ago

As Z-Man mentioned, doing this on an active/online site is not such a great idea because of the potential for the database to be out of sync with backed up files. However, I will admit that I am guilty of doing this simply to make sure I always had daily backups of my sites, and for convenience did not want to announce maintenance/pull the site(s) offline every single day. The way most people deal with that is to run a cron job at a time when you expect no activity on your site (this applies to any site using a database along with some kind of data directory, not just OSSN btw), for example, 3:00 AM. You can then write a short shell script which uses the "tar" command to create an archive of all your site's data and the "mysqldump" command to create a backup of your database. You can look at the unix man pages for these commands or google how to use them. Then just create a new entry in your crontab to run your shell script as often as you would like (again, google is your friend here)... but please don't ignore the issues brought up by Z-Man - depending on how active your site is, you may well run into the issue he described with your db and files being out of sync.

German Michael Zülsdorff Replied 5 years ago

To my knowledge there's currently no such option.

Crontab or any other automatism can't be a good idea because you have to asure first that there are no member activities while backing up. Otherwise the backed-up database and your backed-up data directory may be out of sync because of the delay between both backups. So I'd suggest the following steps:

  1. Anounce your site will be under maintenance from ... to in advance
  2. Login to your Ossn admin panel and asure nobody else but you (1 user) is logged in
  3. Make your site inaccessable by means of the "Site offline" component or renaming index.php to index.php.bak
  4. Use your provider's PHPMyAdmin tool to export the database to a plain ascii file
  5. Login to your webspace by SSH and use zip, tar or any other archiving tool to archive
    a) your Ossn data directory
    b) your Ossn installation directory
  6. Copy these 3 files to a safe place