![]() |
|
ttcDbSnapshotPlugin - 1.0.0Save, load and Sync mysql databases |
|
![]() |
0
user
Sign-in
to change your status |
The ttcDbSnapshotPlugin lets you take snapshot of a database, load a saved snapshot, or take one on your production server and load it on your developement server. |
To be fast and take usable snapshot, the plugin uses mysqldump to save, and mysql to load which are both available on linux/unix system which means windows users won't be able to use this plugin as is.
For now it also parses the databases.yml file to get connection credentials thru Doctrine_Manager which also means Propel users can't use it unless you provide your own getConnectionCredentials() like in baseTtcDbSnapshotTask.class.php
The tasks to do all these actions requires the mysqldump and mysql executable to be available which probably means trouble for windows users but hopefully your production server uses linux and you should be able to get benefits like I do from this plugin.
To take a snapshot: $ symfony ttc:take-snapshot
To load one: $ symfony ttc:load-snapshot
To use the syncing feature with ease, you are not required to but you should create a public/private ssh key pair and upload your public key to your server, then create a config file in your .ssh home folder that would look like this:
Host myprodserver
Hostname myprodserver.com
User prodLinuxUsername
IdentityFile /.ssh/private_key
Port 12345
Then to sync your production data to your dev data, you would use: $ symfony ttc:load-snapshot-from --env=dev myprodserver '/sf' prod
| Name | Status | |
|---|---|---|
|
|
lead |
Copyright (c) 2011 Anthony Servedio
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.