This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* Safe Search and Replace on Database with Serialized Data v2.0.1 | |
* | |
* This script is to solve the problem of doing database search and replace when | |
* developers have only gone and used the non-relational concept of serializing | |
* PHP arrays into single database columns. It will search for all matching | |
* data on the database and change it, even if it's within a serialized PHP | |
* array. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Backups; | |
use BackupManager\Databases\Database; | |
/** | |
* Class MysqlDatabase | |
* @package BackupManager\Databases | |
*/ | |
class MysqlDatabase implements Database { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Create individual SQL files for each database. These files | |
# are imported automatically during an initial provision if | |
# the databases exist per the import-sql.sh process. | |
mysql -e 'show databases' | \ | |
grep -v -F "information_schema" | \ | |
grep -v -F "performance_schema" | \ | |
grep -v -F "mysql" | \ | |
grep -v -F "test" | \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Sync the sql files in the sync folder | |
# | |
# The files in the {vvv-dir}/database/sync/ directory should be created by | |
# mysqldump or some other export process that generates a full set of SQL commands | |
# to create the necessary tables and data required by a database. | |
# | |
# For a sync to work properly, the SQL file should be named `db_name.sql` in which | |
# `db_name` matches the name of a database already created in {vvv-dir}/database/init-custom.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Vagrant Triggers | |
# | |
# If the vagrant-triggers plugin is installed, we can run various scripts on Vagrant | |
# state changes like `vagrant up`, `vagrant halt`, `vagrant suspend`, and `vagrant destroy` | |
# | |
# These scripts are run on the host machine, so we use `vagrant ssh` to tunnel back | |
# into the VM and execute things. By default, each of these scripts calls db_backup | |
# to create backups of all current databases. This can be overridden with custom | |
# scripting. See the individual files in config/homebin/ for details. | |
if defined? VagrantPlugins::Triggers |