mysql-cli-plugin

command module
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

README

mysql-cli-plugin

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

Installation

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

$ cf install-plugin -r CF-Community MysqlTools

Usage

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.

Building

Prerequisites
  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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
mysql-tools
cf
cf/cffakes
Code generated by counterfeiter.
Code generated by counterfeiter.
find-bindings/find-bindingsfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
migrate/migratefakes
Code generated by counterfeiter.
Code generated by counterfeiter.
plugin/pluginfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
unpack/unpackfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
tasks

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL