{"id":23988767,"url":"https://github.com/paulnovack/php-dbserversyncutility","last_synced_at":"2026-04-20T14:07:13.930Z","repository":{"id":174689135,"uuid":"490861336","full_name":"PaulNovack/PHP-DBServerSyncUtility","owner":"PaulNovack","description":"PHP Utility to back up mysql database for local development mostly","archived":false,"fork":false,"pushed_at":"2024-10-29T12:59:46.000Z","size":85,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-29T15:25:24.617Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PaulNovack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-10T21:09:48.000Z","updated_at":"2024-10-29T12:59:50.000Z","dependencies_parsed_at":"2025-01-07T16:15:42.002Z","dependency_job_id":"f634b001-ea8c-458a-9d5f-68272d70a17a","html_url":"https://github.com/PaulNovack/PHP-DBServerSyncUtility","commit_stats":null,"previous_names":["paulnovack/php-dbserversyncutility"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PaulNovack/PHP-DBServerSyncUtility","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulNovack%2FPHP-DBServerSyncUtility","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulNovack%2FPHP-DBServerSyncUtility/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulNovack%2FPHP-DBServerSyncUtility/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulNovack%2FPHP-DBServerSyncUtility/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PaulNovack","download_url":"https://codeload.github.com/PaulNovack/PHP-DBServerSyncUtility/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulNovack%2FPHP-DBServerSyncUtility/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32050454,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-07T16:15:37.915Z","updated_at":"2026-04-20T14:07:13.911Z","avatar_url":"https://github.com/PaulNovack.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DBServerSyncUtility\n\n\u003cimg src=\"https://user-images.githubusercontent.com/3844301/170073844-9e893950-2ca9-4a53-a672-c6724f6de4ca.jpeg\" alt=\"drawing\" width=\"250\"/\u003e\n\n###  2021 PaulNovack  - BSD License 2.0 - notes at bottom of README.md\n\n* Note:  There is a bug in not properly escaping certain reserved words in table names needs to be fixed.  Should get to it soon....\n\nA general purpose configurable Backup Service and Restore Service to sync mySQL databases \nbetween servers with table by table backups.\nIncludes conditions to allow a \"wait\" for other operations to complete \nbefore backing up a list of tables based on a sql statement that evaluates \nto true or false.  Configuration also allows for exclusion of tables that do not need to be synced.\n\nsee article at https://paulnovack.net/article/The%20Value%20of%20a%20Partial%20Database%20Mirroring%20Application%20for%20Web%20Application%20Developers for more information.\n\nDatabases are backed up table by table into a temp database.  This is useful for development so that you can continue to do development work as databases are restored.  Tables are placed in temporary database and then moved to the actual database this allows developers to continue to work while a restore is in process in most cases.\n\nRather than dumping entire database with mysqldump this does so by tables without as much of an interruption.\n\n\n### Running the ServerSynServices:\n\nThere are 2 separate php processes that must run for DB Server Synchronization\n\u003col\u003e\n\u003cli\u003e BackupServiceJob.php - This process is resposible for \niterating thru the databases and creating a *.sql file \nusing mysqldump cli and the configuration in the \nSourceServerConfig.json \nfile and the Default_SyncJobSettings.json file or the config file name passed as an argument at runtime\u003c/li\u003e\n\u003cbr/\u003e\n\n\u003cli\u003e RestoreServiceJob.php - This process is responsible for \niterating thru directories as specified in the Default_SyncJobSettings.json finding *.sql files produced by \nthe BackupServiceJob.php and actually importing them into the destination database specified in DestinationServerConfig.json using mysql cli.  \nThis may be run as a continually running process that will simply watch \nfor *.sql files and process them as they arrive.\n\u003c/li\u003e\n\u003c/ol\u003e\n\n### General notes about usage of this Service:\n\n\n\u003cbr/\u003e\n\u003cli\u003e \u003cstrong\u003eData files directories\u003c/strong\u003e - \nThe service will automatically create the directory \nstructure to store files.   After import the service will \nremove all sql files.\u003c/li\u003e\n\u003cbr/\u003e\n\u003cli\u003e \u003cstrong\u003eImport database\u003c/strong\u003e - \nThe service will \u003cstrong\u003eNOT\u003c/strong\u003e create the database used for importing data into on the destination system.\nThis is a purposefully built safety mechanism to prevent accidental mis-configuration that would overwrite the source databases.\nThe database specified in the Default_SyncJobSettings.json in the field \"tempDatabase\" must be manually created on the destination mysql server.\"  \nData tables will be imported into this temporary database then moved into the correct database.\u003c/li\u003e\n\n## BSD License 2.0\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\nNeither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.[8]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulnovack%2Fphp-dbserversyncutility","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulnovack%2Fphp-dbserversyncutility","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulnovack%2Fphp-dbserversyncutility/lists"}