Migration from 0.8 to 1.x

Hi,

We have a sizeable number (100+) of projects built by a 0.8 drone server.

Is it possible to use the drone migration tool to migrate these piecemeal or is it a big bang only?

Ideally I would like to switch over some projects to the new 1.x instance and keep the others on 0.8 so we can see what issues we have, before migrating the rest.

If this partial migration isn’t possible, and we have to do an all-at-once approach, what sort of issues are we likely to encounter with incompatible pipelines etc.?

I assume we can keep both 0.8 and 1.x pointing at the same source control server (it’s Bitbucket Server 7)?

I’d like to keep the build numbers as these are used as part of the build pipeline for image tags etc.

Thanks,

Martin.

Hi there,

Is it possible to use the drone migration tool to migrate these piecemeal or is it a big bang only?

The automated migration tool is big bang. You would need to migrate the full database in order to use the migration utility.

Ideally I would like to switch over some projects to the new 1.x instance and keep the others on 0.8 so we can see what issues we have, before migrating the rest.

This is the approach we recommend. Instead of an automated migration you can leave the 0.8 instance in place and setup a 1.x instance, and allow teams to move projects over manually.

I’d like to keep the build numbers as these are used as part of the build pipeline for image tags etc.

If you do a periodic, manual migration as suggested above, you can manually override the build counter to match the previous value. For example, if the build number for repository octocat/hello-world is 42 in version 0.8, you could execute the following command in 1.x

drone repo update octocat/hello-world --build-counter=42

This would ensure subsequent builds in 1.x use the previous build number.

If this partial migration isn’t possible, and we have to do an all-at-once approach, what sort of issues are we likely to encounter with incompatible pipelines etc.?

Hopefully very few. You can continue to user 0.8 syntax with 1.x. If you encounter an edge case where a configuration file does not work with 1.x it may require the team to update the yaml to 1.0 syntax. We can help advise if you encounter such an edge case.

The biggest issue you will encounter when migrating to 1.x is that some manual database cleanup may be necessary. This is documented in the readme, but we can also advise on how to resolve.

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.

I should also point out that you can perform a test database migration without impacting your production 0.8 instance. Make sure that every time you test the migration, you are migrating from an 0.8 database (this could be your live database or a snapshot) to a new, empty database. Also make sure you do not execute the final migration step since this configures webhooks in bitbucket and cannot be reversed.

If you perform a test migration it is also safe to activate a few repositories in the test 1.x instance and test their pipelines. Once your testing is complete you would de-activate the repositories in 1.x to remove any leftover webhooks from Bitbucket that point to the test 1.x instance.

Let me know if that helps, or if you need any clarification.

Hi,

Have some questions before trying to migrate drone server from 1.0.0-rc.5 into 1.10.1

  1. Is this tool [1] still works for our migration usecase?
  2. We are using the external database backend(mysql) [2] and wondering
    is it possible to keep and transfer the original repo build job logs into the new drone server?
    The db schema between these two different versions will be the same?
  3. So is the following steps suggested for migration?
    1: prepare another new env
    2: testing pipelines on it
    3: and finally switch to this new env

Thanks

[1] https://github.com/drone/drone-migrate
[2] https://docs.drone.io/server/storage/database/

Have some questions before trying to migrate drone server from 1.0.0-rc.5 into 1.10.1

The migration tool is only required when upgrading from 0.8.x to 1.x. You do not need a migration tool to upgrade from an older version of 1.x to a newer version of 1.x.