drupal

Backup and restore Drupal on Ubuntu

Submitted by Barnaby Golden on Sun, 05/04/2014 - 11:09

How to backup Drupal on an Ubuntu server.

Backup

Script the backing up of the database and file system (password is in .my.cnf file in user home directory):


#!/bin/sh

DRUPAL_HOME=/var/www
BACKUP_HOME=/home/ubuntu

SQL_NAME=/home/ubuntu/bhgagile-sql-dump-$(date +"%Y-%m-%d_%H-%M").sql
FILES_NAME=/home/ubuntu/bhgagile-file-dump-$(date +"%Y-%m-%d_%H-%M").tgz

cd $DRUPAL_HOME

/usr/bin/mysqldump -u root drupal > $SQL_NAME
/bin/gzip $SQL_NAME

/bin/tar -czf $FILES_NAME html

cd $BACKUP_HOME

Restoring

© Copyright 2018 bhgagile Limited

Paperblog

Software Development Blogs - BlogCatalog Blog Directory