Migrate vCloud Director 9.0 DB from MSSQL to Postgres

By | 02/10/2017

With vCloud Director 9.0, VMware introduced postgres as supported database for vCD. If you are planning to use postgres as DB, then you should install Postgres v 9.5 on a supported OS.

In our last Post I mentioned that I purposefully configured MSSQL as DB from my new vCD 9.0 installation, as I wanted to test the migration of vCDDB from MSSQL to Postgres. This post is focussed on how to do so.

If you are new to postgres and do not know how to install it, then follow this blog for installation instructions which are pretty easy and straight forward.

Once you have installed postgres and started services, next is to create database for vCD. Follow below commands to do so

1: Create Database

2: Verify presence of newly created database

3: Create vCloud user and assign password to user

4: Enable the database owner to log in to the database

5: Grant full permission to vCloud user to vCloud database

6: Test the vcloud user access to database

Make sure your postgresql.conf and pg_hba.conf looks like below

Now we are done with DB creation/configuration task. Next is to perform the migration of databse. Unfortunately there is not much info given about this task in vCD 9.0 documentation.

I managed to find the way while playing around in my lab. Database migration is done using the cell management utility which is present in /opt/vmware/vcloud-director/bin directory. We need to use dbmigrate command line option with cell-management-tool.

To see list of supported options run this query

# /opt/vmware/vcloud-director/bin/cell-management-tool dbmigrate –help

vcd-db-migrate-1.PNG

Once you have reviewd the available options, use following command to do the db migration

Run the reconfigure-database command

And thats it. You can now login to postgres db and verify the tables etc.

Additional Reading

What’s New in Vcloud Director 9.0

vCloud Director 9.0 Single Cell Installation

vCD 9.0 Documentation

I hope you find this post informational. Feel free to share this on social media if it is worth sharing. Be sociable 🙂