ttcDbSnapshotPlugin
1.0.0stable
for sf 1.4sf 1.3 and Doctrine
MIT
ttcDbSnapshotPlugin
Usage Scenarios
- You are testing a feature but it's tedious to revert and test again because of many data changes - save data then reload.
- Client has a problem with some of it's data - sync remote prod to local dev and test with real data
Requirements/Limitations
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
Basic Usage
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.
Syncing
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
- Will use the config above to connect thru ssh.
- From the '~/sf' folder on your production, it will use the prod connection and ttc:take-snapshot there.
- Then it will transfer the saved snapshot thru ssh again to data/remote_ttc_db_snapshot_prod.sql
- And finally it will run ttc:load-snapshot --env=dev full_path_to/remote_ttc_db_snapshot_prod.sql
Developers
License
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.
Releases for sf 1.4
| Version |
License |
API |
Released |
|
1.0.0stable
|
MIT license |
1.0.0stable
|
30/05/2011 |
Releases for sf 1.3
| Version |
License |
API |
Released |
|
1.0.0stable
|
MIT license |
1.0.0stable
|
30/05/2011 |
Changelog for release 1.0.0 - 30/05/2011
Other releases
Release 1.0.0 - 30/05/2011
ttcDbSnapshotPlugin
Usage Scenarios
- You are testing a feature but it's tedious to revert and test again because of many data changes - save data then reload.
- Client has a problem with some of it's data - sync remote prod to local dev and test with real data
Requirements/Limitations
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
Basic Usage
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.
Syncing
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
- Will use the config above to connect thru ssh.
- From the '~/sf' folder on your production, it will use the prod connection and ttc:take-snapshot there.
- Then it will transfer the saved snapshot thru ssh again to data/remote_ttc_db_snapshot_prod.sql
- And finally it will run ttc:load-snapshot --env=dev full_path_to/remote_ttc_db_snapshot_prod.sql