Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgreSQL examples included in example overrides & PostgreSQL doc improvements #20

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions contrib/example-overrides
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,26 @@
#
# You can mix positive overrides with negative overrides.
#
# Format
# MySQL/MariaDB Format
#
# -?mysql:database[/table]
#
# Examples
# MySQL/MariaDB Examples
#
# (exclude Drupal10 sessions table)
# -mysql:drupal10/sessions
#
# (only include drupal10 database)
# mysql:drupal10
#
# PosgreSQL Format
#
# -?pgsql:database[/table]
#
# PosgreSQL Examples
#
# (exclude my_db test table)
# -pgsql:my_db:test
#
# (only include my_db database)
# pgsql:my_db
40 changes: 30 additions & 10 deletions docs/tklbam-backup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,34 @@ Database overrides

``<database-override>`` := -?pgsql:database[/table]

By default ALL databases and database tables are backed up.
By default ALL MySQL/MariaDB databases and database tables are backed up.

Adding a positive override (e.g., mysql:mydatabase) changes the default
behavior so that only the database or table specified in the override is
included in the backup.
Similarly, ALL PostgreSQL are included - with the exception of the `postgres`
database - an empty database included by default in all PostgreSQL installs.

Negative overrides exclude a database (e.g., -mysql:mydatabase) or table (e.g.,
-mysql:mydatabase/mytable) from being included in the backup.
Exclusion of default `postgres` PostgreSQL database
---------------------------------------------------

The exclusion of the `postgres` database can NOT be overriden, even if
explictly added as an override.

Some documentation suggests that it is "best practice" to not use the default
`postgres` database for user data. However, there is no documented strict
reason why it shouldn't be used. So the inability to include this database is
considered a bug and will be addressed in a future TKLBAM update. If you are
already using the `postgres` database, the database can be renamed, or you can
move your data to a new database.

Database override details
-------------------------

Adding a positive override (e.g., mysql:mydatabase / pgsql:mydatabase )
changes the default behavior so that only the database or table specified in
the override is included in the backup. If you wish to use overrides to
include multiple databases but not all, they must all be noted separately.

Negative database/table overrides (with a dash prefix) exclude a database or
table (e.g. -mysql:mydatabase / -pgsql:mydatabase).

Excluding a table only excludes its data. The schema of an excluded table is
still backed up, as it takes up a trivial amount of space and other tables or
Expand All @@ -81,11 +101,11 @@ You can mix positive overrides with negative overrides.

Examples::

# exclude Drupal6 sessions table
-mysql:drupal6/sessions
# exclude Drupal10 sessions table
-mysql:drupal10/sessions

# only include drupal6 database
mysql:drupal6
# only include drupal10 database
mysql:drupal10

# only include mahara postgres database
pgsql:mahara
Expand Down
9 changes: 5 additions & 4 deletions docs/tklbam-restore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,13 @@ System restore options

--simulate Do a dry run simulation of the system restore

--limits=LIMITS Restore filesystem or database limitations. You can use this
to control what parts of the backup will be restored.
--limits=LIMITS Restore filesystem or database limitations

Preceding a limit with a minus sign
turns it into an exclusion.
Used to control what parts of the backup will
be restored.

Preceding a limit with a minus sign turns it
into an exclusion.
Mutliple items are space separated. Spaces in paths must be
escaped. E.g. --limits="/path\ with\ spaces -/another\ path"

Expand Down