-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathREADME.txt
84 lines (65 loc) · 3.52 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Drupal Git Backup (DGB)
=======================
DGB is a Drush command to easily maintain a full backup a Drupal code base and
all its sites, keeping Drupal files and sites databases together in sync in the
same repository. It supports multi site setups and will dump each site database
as a version control friendly SQL file. This command leverages git as a powerful
(decentralized) version control system to store all websites' data efficiently.
This Drush command is still at an experimental state so use with caution. Please
give any feedback or file bugs at http://github.com/scor/dgb
DGB requires Drush <http://drupal.org/project/drush> and works for any version
of Drupal 5, 6 and 7.
Installation
============
Install dgb like any other Drush command. See Drush readme.txt file. The typical
directory structure dgb was designed for is the following:
-- dgb_instance --> drupal --> index.php
--> sites --> example1.com
--> example2.com
--> databases --> example1.com.sql
--> example2.com.sql
--> .git (dgb git repository)
1. create the dgb_instance folder somewhere on your server (the name does not
matter). Make sure it's outside the web public directory.
2. place your drupal code base in the dbg_instance directory, e.g. in a drupal
directory.
3. create the 'databases' folder (that is the default dump director that dgb
expect, you can change that in drushrc.php, see below).
6. initialize the git repository in the dgb_instance folder by running git init.
You might want to create a .gitignore file to ignore certains files, for
example .svn if you version your files with svn.
7. from the DRUPAL_ROOT directory, type drush dgb-backup to see if dgb was
installed successfully. This will do the initial backup of your dgb_instance,
this initial backup might take a while depending on the number of sites you
have and their size.
8. setup a cron job to run the backup every day or so, e.g. to run dgb every day
at 11am:
00 11 * * * cd /var/sites/dgb_instance/drupal; /usr/local/bin/drush dgb-backup
(adapt /usr/local/bin/drush to wherever your drush is located on your server)
9. The following steps are optional. They allow to customize the names of the
directories you want to use etc.
copy example-dgb.drushrc.php in each site settings directory (.e.g
sites/default/), rename it to drushrc.php and check its content.
Its default settings should works for most configurations.
Commands
========
dgb ships with several commands:
- dgb-dump: Dumps all the databases of a Drupal installation. Alternative to the
core sql-dump command, with support for table name expansion and ]
validation.
- dgb-commit: Commits Drupal installation directory including the files
directory of all sites, as well as the SQL dumps directory if they
are located in the same master backup directory (typically one
level up DRUPAL_ROOT).
- dgb-usage: Displays some information on the current size of the repository and
the Drupal installation.
- dgb-backup: Wrapper command to dump, commit and display the size of the Drupal
installation and repository
Author
======
Stéphane "scor" Corlosquet <[email protected]>
References
==========
This drush command uses a similar approach to the one used in dbscripts
<http://drupal.org/project/dbscripts> except it is fully integrated in drush as
opposed to using custom bash scripts.