We have to implement the alembic db migration
cd /usr/lib/python2.7/dist-packages/neutron_lbaas/db/migration/alembic_migrations/$
we need a alembic.ini configuration file. What I did is to copy this file from the neutron package:
cp /usr/lib/python2.7/dist-packages/neutron/db/migration/alembic.ini .
At this point we can start a new alembic migration
alembic revision -m "migrate to LBaaSv2"
This will create a new and empty file with the new alembic migration, with the following name:
versions/<hash>_migrate_to_lbaasv2.py
Where the hash changes every time.
Now append to this file the user contributed script to make the migration from LBaaSv1 and LBaaSv2
wget -O - https://gist.githubusercontent.com/zioproto/d01596e9c28f930ed811875bc5fce745/raw/38024e85972ab6c932bf23d96171d770a4dda184/openstack-lbaas-database-migration-from-v1-to-v2.py >> alembic_migrations/versions/<hash>_migrate_to_lbaasv2.py
Now you have to check your database tables and hack the script
Check https://review.openstack.org/444930
When the file looks good you can try to run the migration with the command
neutron-db-manage upgrade heads