{"id":37197564,"url":"https://github.com/drone/drone-migrate","last_synced_at":"2026-01-14T22:57:49.340Z","repository":{"id":34401455,"uuid":"160639903","full_name":"drone/drone-migrate","owner":"drone","description":"Migration utility from Drone 0.8.x to 1.0.x","archived":false,"fork":false,"pushed_at":"2020-09-11T18:26:48.000Z","size":83,"stargazers_count":33,"open_issues_count":4,"forks_count":11,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-06-20T13:38:16.125Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"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/drone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-06T07:59:49.000Z","updated_at":"2022-01-05T11:06:52.000Z","dependencies_parsed_at":"2022-08-08T01:00:27.094Z","dependency_job_id":null,"html_url":"https://github.com/drone/drone-migrate","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/drone/drone-migrate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drone%2Fdrone-migrate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drone%2Fdrone-migrate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drone%2Fdrone-migrate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drone%2Fdrone-migrate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drone","download_url":"https://codeload.github.com/drone/drone-migrate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drone%2Fdrone-migrate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28437608,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: 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":"2026-01-14T22:57:48.494Z","updated_at":"2026-01-14T22:57:49.315Z","avatar_url":"https://github.com/drone.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Migration utility will help you migrate from a Drone 0.8.x database to a Drone 1.0.x database.\n\n___Please note the migration utility may require manual database cleanup.___ For example, in 0.8 the same repository can be listed in the database twice if it has been renamed, however, in 1.0 this will cause unique key violations. These edge cases require manual intervention. You should therefore be comfortable with sql and database troubleshooting before you proceed.\n\n## Preparing for the migration\n\n1. create a full backup of your 0.8.x Drone database\n2. create a new database for your 1.0.x server\n3. do not create or start your drone 1.0 container until this is complete\n\n## Download the migration utility\n\n```\ndocker pull drone/migrate\n```\n\n## Configuring the migration utility\n\nThe migration utility will copy data from your 0.8.x database to your new _empty_ 1.0.x database. You will need to provide the migration tool with the connection string for both the old and new database.\n\n```sh\n-e SOURCE_DATABASE_DRIVER=sqlite3|mysql|postgres\n-e TARGET_DATABASE_DRIVER=sqlite3|mysql|postgres\n-e SOURCE_DATABASE_DATASOURCE=/path/to/old/database.sqlite\n-e TARGET_DATABASE_DATASOURCE=/path/to/new/database.sqlite\n```\n\nConfigure the Drone 1.0 server address:\n\n```\n-e DRONE_SERVER=https://drone.company.com\n```\n\nIf you are using GitHub, configure the GitHub driver:\n\n```sh\n-e SCM_DRIVER=github\n-e SCM_SERVER=https://api.github.com\n```\n\nIf you are using GitHub Enterprise, configure the GitHub driver:\n\n```sh\n-e SCM_DRIVER=github\n-e SCM_SERVER=https://github.company.com/api/v3\n```\n\nIf you are using Gogs, configure the Gogs driver:\n\n```sh\n-e SCM_DRIVER=gogs\n-e SCM_SERVER=https://gogs.company.com\n```\n\nIf you are using Gitea, configure the Gitea driver:\n\n```sh\n-e SCM_DRIVER=gitea\n-e SCM_SERVER=https://gitea.company.com\n```\n\nIf you are using Stash, configure the Stash driver:\n\n```sh\n-e SCM_DRIVER=stash\n-e SCM_SERVER=https://stash.company.com\n-e STASH_CONSUMER_KEY=OauthKey\n-e STASH_PRIVATE_KEY_FILE=/path/to/private/key.pem\n```\n\nIf you are using Bitbucket Cloud, configure the Bitbucket driver:\n\n```sh\n-e SCM_DRIVER=bitbucket\n-e BITBUCKET_CLIENT_ID=$your_client_id\n-e BITBUCKET_CLIENT_SECRET=$your_client_secret\n```\n\n# Full Migration\n\nRun the below migration steps to copy your data from your 0.8 database to your 1.x database. _Running the below commands will not have any impact on your existing 0.8 database._\n\n```\n$ docker run -e [...] drone/migrate setup-database\n$ docker run -e [...] drone/migrate migrate-users\n$ docker run -e [...] drone/migrate migrate-repos\n$ docker run -e [...] drone/migrate migrate-secrets\n$ docker run -e [...] drone/migrate migrate-registries\n$ docker run -e [...] drone/migrate migrate-builds\n$ docker run -e [...] drone/migrate migrate-stages\n$ docker run -e [...] drone/migrate migrate-steps\n$ docker run -e [...] drone/migrate migrate-logs\n$ docker run -e [...] drone/migrate update-repos\n$ docker run -e [...] drone/migrate remove-renamed\n$ docker run -e [...] drone/migrate remove-not-found\n```\n\n## Optional Encryption\n\nYou can also optionally [configure](https://docs.drone.io/server/storage/encryption/) secret encryption in Drone 1.0. If you plan on enabling encryption you will need to encrypt the secrets before you complete the migration.\n\n```\n$ export TARGET_DATABASE_ENCRYPTION_KEY=....\n$ docker run -e [...] -e drone-drone/migrate encrypt-secrets\n```\n\n## Final Migration Step\n\nThe final step is to re-activate your repositories. At this time it is safe to start your Drone server. Once the server is started you can execute the final migration command:\n\n```\n$ docker run -e [...] drone/migrate activate-repos\n```\n\n_The above command should only be executed once you are ready to finalize your migration.  When you execute this command it may replace any webhooks created by your 0.8 instance with webhooks that point to your 1.x instance._\n\n\n## Final Check\n\nThe migration is not considered complete until all steps are completed and the below sql query returns an empty result set.  If the below query does not return an empty result set you should execute the optional `remove-renamed` and `remove-not-found` migration steps.\n\n```text\nSELECT *\nFROM repos\nWHERE repo_uid LIKE 'temp_%'\n```\n\n# Execution Individual Commands\n\nThis can be helpful if a particular migration step fails. You can safely truncate the impacted database table and then re-try the migration.\n\n## Create the 1.0 database\n\n```shell\n$ docker run -e [...] drone/migrate setup-database\n```\n\n## Migrate users from 0.8 to 1.0\n\n```shell\n$ docker run -e [...] drone/migrate migrate-users\n```\n\n## Migrate repositories from 0.8 to 1.0\n\n```shell\n$ docker run -e [...] drone/migrate migrate-repos\n```\n\n## Migrate builds from 0.8 to 1.0\n\n```shell\n$ docker run -e [...] drone/migrate migrate-builds\n```\n\n## Migrate stages from 0.8 to 1.0\n\n```shell\n$ docker run -e [...] drone/migrate migrate-stages\n```\n\n## Migrate steps from 0.8 to 1.0\n\n```shell\n$ docker run -e [...] drone/migrate migrate-steps\n```\n\n## Migrate logs from 0.8 to 1.0\n\n```shell\n$ docker run -e [...] drone/migrate migrate-logs\n```\n\nyou can optionally migrate logs to s3 storage. _Note that the migration utility authenticates with aws using standard authentication methods, including aws_access_key_id and aws_secret_access_key_\n\n\n```shell\n$ docker run -e S3_BUCKET=\u003cbucket\u003e -e [...] drone/migrate migrate-logs-s3\n```\n\n## Migrate secrets from 0.8 to 1.0\n\nSecrets stored within Drone can be migrated, if you use some external tool to store your secrets like Vault you can skip this step.\n\n```shell\n$ docker run -e [...] drone/migrate migrate-secrets\n```\n\n## Migrate registry credentials from 0.8 to 1.0\n\nIf you haven't used ayn private images within the pipeline you can skip this step, this is only needed if you are using private Docker images for your Drone steps.\n\n```shell\n$ docker run -e [...] drone/migrate migrate-registries\n```\n\n## Update the repository metadata\n\nDrone 1.0 stores addition repository metadata that needs to be fetched from the source code management system. This additional metadata is required.\n\n```shell\n$ docker run -e [...] drone/migrate update-repos\n```\n\n## Activate the repositories\n\nThe final step is to ensure all repositories are activated and have a valid web-hook configured in the source code management system.\n\n```shell\n$ docker run -e [...] drone/migrate activate-repos\n```\n\n## Dump Tokens (Optional)\n\nYou can optionally dump 0.8 user API tokens for use with 1.0 as described [here](https://github.com/drone/drone/issues/2713). If your team heavily uses Drone tokens in their build process (to trigger downstream builds, etc) you may find this helpful.\n\n```shell\n$ docker run -e [...] drone/migrate dump-tokens\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrone%2Fdrone-migrate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrone%2Fdrone-migrate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrone%2Fdrone-migrate/lists"}