Skip to content
Switch branches/tags
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


The mysql-tools plugin can be used to migrate a p-mysql (v1) service instance to a p.mysql (v2) service instance.


A binary version of the plugin can be installed from the CF-Community plugin repository:

$ cf install-plugin -r CF-Community MysqlTools


Once the plugin is installed, migrate a v1 service instance to a new v2 service instance with the following command:

$ cf mysql-tools migrate V1-INSTANCE V2-PLAN

Where V1-INSTANCE is the the name of the v1 service instance that you wish to migrate, and V2-PLAN is the name of the v2 service plan to use for the new v2 service instance.

This will create a new v2 service instance and copy the data from the v1 service instance into it.

At the end of this operation, the v2 service instance will have the same name as the original v1 service instance (V1-INSTANCE), and the v1 instance will have -old appended to its name.

More detailed instructions are available in the MySQL for PCF docs.

Some Notice:

  • Stop all apps bound to the service instance before migrating.
  • The Database instance should not be receiving any write traffic while the migration is happening.
  • The apps bounded to the original v1 service instance need to be manually bound to the new v2 service instance at the end of the migration.
  • There will be token timeout messages when migrating lots of data, which can be ignored.



  1. cd into the root directory of the project.

  2. Run the following script to build the mysql binary and other assets, generate golang fixtures, and compile the binary

    $ ./scripts/build-plugin

Once the build-plugin script has been run and the assets have been built, you can alternatively use the following commands to just build the go code

  1. Generate fixtures
    $ go generate ./...
  2. Compile the final binary
    $ go build .

Cleaning Up

$ packr clean