Navigate to folder on server where 'drupal' folder is stored and create a backup tar -cf 17sep19drupal.tar drupal

(please note that when restoring an archive -cf is replaced with -xf)

Copy (or move) the .tar file you have created to your backups folder.

Take a copy of the drupal database mysqldump drupal > dr17sep19.sql

Copy (or move) the .sql file you have created to your backups folder.

It's probably a good idea to do a local test of the backup - the mysql commands to set up the drupal database locally used are as follows:

create database drupal;

use drupal;

source dr17sep.sql;

if you have previously tested the backup locally then remember to purge the old drupal database

drop database drupal;

show tables; is a handy command for checking how many tables you have

show databases; is a handy command for checking which databases you have

note that the local database will not have a password so edit the drupal settings file for a blank password

note that if you have set up trusted host patterns in the drupal settings file then remove the leading "/" so drupal ignores it

*/
  $settings['trusted_host_patterns'] = [
    '^boliston\.co\.uk$',
  ];
/**

alternatively you can substitute localhost for the domain name to test locally

*/
  $settings['trusted_host_patterns'] = [
    '^localhost$',
  ];
/**

Tags