{"id":21421509,"url":"https://github.com/desarrolla2/download-bundle","last_synced_at":"2025-07-14T08:30:37.664Z","repository":{"id":56965990,"uuid":"127112327","full_name":"desarrolla2/download-bundle","owner":"desarrolla2","description":"This bundle allows you to download a database and folders associated with the project from remote host to local machine. It is the easiest and easiest way to have the same production data in your development environment.","archived":false,"fork":false,"pushed_at":"2024-08-21T20:21:45.000Z","size":182,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-15T18:09:01.809Z","etag":null,"topics":["database","symfony"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/desarrolla2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-28T08:55:16.000Z","updated_at":"2024-08-21T20:21:49.000Z","dependencies_parsed_at":"2023-01-23T11:01:02.965Z","dependency_job_id":null,"html_url":"https://github.com/desarrolla2/download-bundle","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/desarrolla2%2Fdownload-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/desarrolla2%2Fdownload-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/desarrolla2%2Fdownload-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/desarrolla2%2Fdownload-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/desarrolla2","download_url":"https://codeload.github.com/desarrolla2/download-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225963888,"owners_count":17552403,"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":["database","symfony"],"created_at":"2024-11-22T20:35:39.610Z","updated_at":"2024-11-22T20:35:40.584Z","avatar_url":"https://github.com/desarrolla2.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Download Bundle\n\nThis bundle allows you to download a database and folders associated with the project from remote host to local machine. \nIt is the easiest and easiest way to have the same production data in your development environment.\n\nThe bundle works using ssh connections so it is necessary that you have configured to connect through a public key.\n\n**Disclaimer**: This bundle works only for environments with linux.  \n\n## Installation\n\nDownload the Bundle.\n\n```bash \ncomposer require --dev \"desarrolla2/download-bundle\"\n```\n\nEnable the Bundle\n\n```php\n// app/AppKernel.php\n\n// ...\nclass AppKernel extends Kernel\n{\n    public function registerBundles()\n    {\n        // enable it only for dev environment\n        if (in_array($this-\u003egetEnvironment(), ['dev'], true)) {\n            $bundles[] = new Desarrolla2\\DownloadBundle\\DownloadBundle();\n        }\n\n        // ...\n    }\n\n    // ...\n}\n```\n\n## Configuration\n\nYou need put something like this in your config_dev.yml\n\n```yml\ndownload:\n    user: 'deploy_user'\n    host: 'production_host_or_ip'\n\n    # optional parameter. use it if you want customize max proccess time\n    timeout: 300\n\n    database:\n        # local directory to save databases\n        directory: '%kernel.root_dir%/../var/data/databases'\n        \n        # optional parameter. use it for tables that you just want to download the structure, not data\n        only_structure:\n          - 'mail_history'\n\n        remote:\n            host: 'production_database_host'\n            name: 'production_database_name'\n            user: 'production_database_user'\n            password: 'production_database_password'           \n\n        local:\n            host: '%database_host%'\n            name: '%database_name%'\n            user: '%database_user%'\n            password: '%database_password%'\n\n        # optional parameter. define max number of database files to keep on local directory\n        max_local_db: 0\n\n    # some directories that you want download.\n    directories:\n        web_uploads:\n            remote: '/path/to/project/web/uploads'\n            local: '%kernel.root_dir%/../web'\n            # you can exclude some directories from there\n            exclude:\n                - 'cache'\n\n        var_data:\n            remote: '/path/to/project/var/data'\n            local: '%kernel.root_dir%/../var'\n            exclude:\n                - 'spool'            \n            \n```\n\n## Usage\n\n### Download\n\nWhen you execute this command, both the database and the directories are downloaded from the remote environment.\n\n```bash\nphp bin/console downloader:download\n```\n\nThis is what you will see in your command line.\n\n![screenshot](https://raw.githubusercontent.com/desarrolla2/download-bundle/master/doc/img/screenshot_1.png)\n\n### Load\n\nMaybe you want to put your local database in a previous state. This bundle keeps a copy of every download you have made, \nso going back to one of these states is very easy.\n\n```bash\nphp bin/console downloader:load\n```\n\nSelect from available dates.\n\n![screenshot](https://raw.githubusercontent.com/desarrolla2/download-bundle/master/doc/img/screenshot_2.png)\n\nThis is what you will see in your command line.\n\n![screenshot](https://raw.githubusercontent.com/desarrolla2/download-bundle/master/doc/img/screenshot_3.png)\n\n### Delete old databases\n\nDelete old databases from the local directory. The max number of files you can keep is defined by max_local_db parameter\n\n```bash\nphp bin/console downloader:delete:old\n```\n\n## Contact\n\nYou can contact with me on [@desarrolla2](https://twitter.com/desarrolla2).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdesarrolla2%2Fdownload-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdesarrolla2%2Fdownload-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdesarrolla2%2Fdownload-bundle/lists"}