= How to Perform at Backup of a Simple LAMP Server.

Outline:

* What Do we need to back up?
	** /home
	** /etc
	** /var/www
	** MySQL/MariaDB
* How to we back it up?
	** Network Storage and Cloud
	** Physical Media
	** Scripts
	** Bakula
* How do we restore from backup?
* How do we automate the process?
	** Crontabs


== Revision History
[cols="<,<,<,<",options="header",]
|==========================================================================================================================================================
|Revision |Date |Person |Note
|Revision 1.0 |2016-02-24 |Revised by: Jason Evans | Initial writing and compiling
|==========================================================================================================================================================
		
== Introduction

Losing data is no laughing matter. Disks fails, servers crash, and sometimes mistakes happen. How do we avoid catastrophic losses of data? We make backups! This guide is an attempt to show the Linux newbie how to back up a simple web server, but it's not limited to that. Using the techniques in this quide, you can back up your LAMP server to network, cloud, or physical storage. While it's written for a LAMP server specifically, this guide is meant to be more than just a dry howto for a specific type of server. Linux is flexible and easy to adapt to a number of uses. Where you learn one skill, you can apply it to a thousand other issues.

== License Information

This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.

== Disclaimers

No liability for the contents of this documents can be accepted by the author, the http://www.tldp.org/[Linux Documentation Project] or anyone else. Use the concepts, examples and other content at your own risk. There may be errors and inaccuracies that may have unexpected results. Proceed with caution and although errors are unlikely, the author take no responsibility for them.

You are strongly recommended to take a backup of your system before major installation and backups at regular intervals. In addition, you are strongly recommended to use a sacrificial VM when experimenting.

== Credits

Thanks to Larisa Alekseeva for your support and to the http://trilug.org[Triangle Linux Users Group] for helping me get a foothold in Linux.

Thanks to http://www.charlescurley.com/[Charles Curley] for creating the original http://tldp.org/HOWTO/Linux-Complete-Backup-and-Recovery-HOWTO/index.html[Linux Complete Backup and Recovery HOWTO]

== Feedback

Feedback is most certainly welcome for this document. Without your corrections, suggestions and other input, this document wouldn't exist. Please send your additions, comments and criticisms to me at: jason.s.evans@gmail.com

== Translations

Volunteers are welcome.

== Overview

== Preparation

In order to You will need a computer or server running CentOS or Ubuntu in a LAMP (Linux, Apache, MySQL, PHP) configuration. You may apply the strategies discussed to many other distributions such as Red Hat Enterprise Linux, Fedora, Debian, or one of their derivatives. This guide touches on physical servers and VM's (virtual machines).

Note: 
Do your normal backups on their regular schedule. This HOWTO is useless if you don't do that.

=== How can I replicate backup the examples:

All examples in this HOWTO will be performed on fresh installations of https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-centos-7[CentOS 7] and https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04[Ubuntu 14.04 LTS]. You can use the linked HOWTO's to bring your test system up to the same level if you wish. I will also create a small MySQL database using steps from https://codex.wordpress.org/Installing_WordPress#Using_the_MySQL_Client[Wordpress] in order to show how to backup and restore it.

== What do I need to back up?

There are three directories that absolutely must be backed up: `/home`, `/var/www`, and `/etc` as well as the MySQL database.

=== Where do we begin?

