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
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 (
and the v1 instance will have
-old appended to its name.
More detailed instructions are available in the MySQL for PCF docs.
- 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.
cdinto the root directory of the project.
Run the following script to build the mysql binary and other assets, generate golang fixtures, and compile the binary
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
- Generate fixtures
$ go generate ./...
- Compile the final binary
$ go build .
$ packr clean