In light of recent events, where I managed to delete a database that I shouldn’t have… I figured I should make sure that all of my Heart Internet hosted Drupal accounts are backed up on a daily basis…
As this is very easily done on a Drupal site via the ‘Backup and Migrate’ module, I figured I’d set them all up and create some instructions at the same time…
- Make sure the ‘Backup & Migrate’ module is there, if not, go here (http://drupal.org/project/backup_migrate), download, unzip, upload, turn on, etc…
- The main settings page is ‘Content management > Backup and migrate’, (or ‘admin/content/backup_migrate’).
- You can take a manual back-up and save it to your computer simply by pressing the ‘Backup Now’ button, but we need to setup an automatic backup using the ‘Schedules’ tab, (or ‘admin/content/backup_migrate/schedule’).
- You will need to click the ‘Create a new schedule’ link, and then fill in the form as follows:
- Enabled tickbox – leave ticked.
- Schedule Name – Use something descriptive like ‘Daily save to live server’.
- Settings Profile – Leave as ‘Default Settings’.
- Backup every – Leave as ‘1 Days’.
- Number of Backup file to keep – I’d suggest to set to 30.
- Destination – Leave as ‘Scheduled Backups Directory’.
- Press ‘Save schedule’.
- Once setup, you’ll be back at the main ‘Schedule’ screen and you’ll see the details of the schedule you’ve just set up. It also says that it’s ‘Never’ been run… At this point it’s worth checking that the ‘Scheduled task has been set-up. To check this, do the following:
- Set up ‘Scheduled Tasks’ from the Heart Internet Control panel for this domain.
- So login to the main Heart Internet site (I’m using a ‘Reseller’ account, but if you’re not, skip to step 4),
- go to ‘RCC’, then ‘Manage Hosting Accounts’, select ‘Superuser’ for the domain/site we’re setting up…
- A new tab will open and you need to click ‘Scheduled Tasks’, under ‘Web Tools’.
- You should see a task set-up in the first box, if not, do the following:
- Under ‘Run this command’ paste: /usr/bin/php5 /home/sites/##########.co.uk/public_html/cron.php
- Change ‘##########’ for the domain name (no www.) and leave the other settings as they are.
- Press ‘Update’ to save.
- To test the ‘Automatic Backup’, press ‘Test Command’, and you should get a message back ending with ‘Content-Type: text/html; charset=utf-8’.
- Go back to the main ‘Backup and Migrate Schedule’ screen (admin/content/backup_migrate/schedule) and check the details of the schedule you’ve just set up.
- ‘Last run’ should now show thew date and time you pressed the ‘Test Command’ button.
- If not, press ‘F5’ and check again, and if it’s still not working, re-trace your steps.
Back-up and Migrate can also email back-ups to an email address. To do this, follow these instructions:
- From the main settings page (‘Content management > Backup and migrate’, or ‘admin/content/backup_migrate’), select the ‘Destinations’ tab.
- You’ll see a few default settings in the list, but you need to click the ‘Create a new destination’ link.
- The next page offers several options, but we and ‘Email’ at the bottom, so click that link.
- The next page just has 2 fields:
- Destination name – This is really just a title to be displayed in the list on the main ‘Destinations’ page, so title it something like ‘Email to me’.
- Email Address – Add the same email you put in the field above.
- Press the ‘Save destination’ button.
- Now that we have the ‘destination’ we need to set-up the ‘schedule’.
- Do exactly the same as you did in the first set of instructions, but when you get to the ‘Create a new schedule’ form:
- For ‘Destination’, use the drop down and select your destination title, i.e. ‘Email to me ’
- For ‘Backup every’, select how often you want the email to be sent… If already saving every day for a month, this can be set to ‘4 weeks’.
- If set to ‘4 weeks’, set ‘Number of Backup files to keep’ to ‘13’, which covers us for a year.
- To test, just ‘run cron’ (admin/reports/status/run-cron).
Hope this helps
Main Category
Secondary Categories