{"id":15628327,"url":"https://github.com/dcblogdev/laravel-db-sync","last_synced_at":"2025-05-16T10:06:35.881Z","repository":{"id":39573422,"uuid":"506690782","full_name":"dcblogdev/laravel-db-sync","owner":"dcblogdev","description":"Sync a remote DB to a local DB","archived":false,"fork":false,"pushed_at":"2024-08-10T18:05:06.000Z","size":56,"stargazers_count":318,"open_issues_count":0,"forks_count":32,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-11T01:30:59.003Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcblogdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"license.md","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},"funding":{"github":["dcblogdev"]}},"created_at":"2022-06-23T15:18:10.000Z","updated_at":"2025-04-05T12:02:24.000Z","dependencies_parsed_at":"2023-02-19T00:05:15.384Z","dependency_job_id":"3667fc12-eaa2-422b-9744-31901067373b","html_url":"https://github.com/dcblogdev/laravel-db-sync","commit_stats":{"total_commits":46,"total_committers":7,"mean_commits":6.571428571428571,"dds":"0.21739130434782605","last_synced_commit":"2258f1393839f05a43f891e54b2c4886c7fdedb6"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcblogdev%2Flaravel-db-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcblogdev%2Flaravel-db-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcblogdev%2Flaravel-db-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcblogdev%2Flaravel-db-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcblogdev","download_url":"https://codeload.github.com/dcblogdev/laravel-db-sync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254509476,"owners_count":22082891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-10-03T10:21:56.705Z","updated_at":"2025-05-16T10:06:35.856Z","avatar_url":"https://github.com/dcblogdev.png","language":"PHP","readme":"## Community\n\nThere is a Discord community. https://discord.gg/VYau8hgwrm For quick help, ask questions in the appropriate channel.\n\n# Laravel DB Sync\n\n![DB Dync](https://repository-images.githubusercontent.com/506690782/a5b01352-4869-4e6d-8e46-d44e93c960df)\n\n## Introduction\nSync remote database to a local database\n\n\u003e A word of warning you should only sync a remote database into a local database if you have permission to do so within your organisation's policies. I'm syncing during early phases of development where the data is largely test data and not actual customer data.\n\nConnection can be made over SSH or using a remote MySQL connection.\n\n## Install\n\nInstall the package.\n\n```bash\ncomposer require dcblogdev/laravel-db-sync\n```\n\n## Config\n\nYou can publish the config file with:\n\n```\nphp artisan vendor:publish --provider=\"Dcblogdev\\DbSync\\DbSyncServiceProvider\" --tag=\"config\"\n```\n\n## .env\n\nSet the remote database credentials in your .env file\n\nWhen using SSH Add:\n```\nREMOTE_USE_SSH=true\nREMOTE_SSH_PORT=22\nREMOTE_SSH_USERNAME=\nREMOTE_DATABASE_HOST=\n\nREMOTE_DATABASE_USERNAME=\nREMOTE_DATABASE_PORT=3306\nREMOTE_DATABASE_NAME=\nREMOTE_DATABASE_PASSWORD=\nREMOTE_DATABASE_IGNORE_TABLES=''\n\nREMOTE_REMOVE_FILE_AFTER_IMPORT=true\nREMOTE_IMPORT_FILE=true\n```\n\nFor only MySQL remote connections:\n```\nREMOTE_DATABASE_HOST=\nREMOTE_DATABASE_USERNAME=\nREMOTE_DATABASE_PORT=3306\nREMOTE_DATABASE_NAME=\nREMOTE_DATABASE_PASSWORD=\nREMOTE_DATABASE_IGNORE_TABLES=''\n\nREMOTE_REMOVE_FILE_AFTER_IMPORT=true\nREMOTE_IMPORT_FILE=true\n```\n\nSet a comma seperate list of tables NOT to export in `REMOTE_DATABASE_IGNORE_TABLES`\n\nTo generate a SQL with a custom file name `REMOTE_DEFAULT_FILE_NAME`\n\nTo specify a different local database connection:\n```\nLOCAL_TARGET_CONNECTION=different_mysql_connection\n```\n\nSet the mysql command path:\n\n```\nLOCAL_MYSQL_PATH=/usr/bin/mysql\n```\n\nFor only mysqldump:\n```\nREMOTE_MYSQLDUMP_SKIP_TZ_UTC=true\n```\n\n## Usage\n\nTo export a remote database to OVERRIDE your local database by running:\n\n```bash\nphp artisan db:production-sync\n```\n\nProvide a filename for export on the fly by passing the option --filename, remember to provide .sql\n\n```bash \nphp artisan db:production-sync --filename=other.sql\n```\n\nRun the command without attempting to export:\n\n```bash \nphp artisan db:production-sync --test\n```\n\n## Aliases\n\nThere are shortcuts that can be used:\n\n`-T` = will use `--test`\n`F` = will use `--filename`\n\n## Alternative name\n\nWhen connecting to a none production database, say a staging database you can choose to use this alternative name:\n\n`db:remote-sync` may be used instead of `db:production-sync`\n","funding_links":["https://github.com/sponsors/dcblogdev"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcblogdev%2Flaravel-db-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcblogdev%2Flaravel-db-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcblogdev%2Flaravel-db-sync/lists"}