Best way to migrate schema, user ids, and permissions for Vertica
Hi there,
We have a leased physical box I need to get off of. It runs Vertica 6.1.1.
We will be migrating to another 1 noder - and then eventually a 3 node cluster.
The developers don't have any schemas, user ids, permission, etc backed up in files. I'm hoping to reverse engineer the system tables to grab table definitions, schema and load it on to the new box.
I figure script kind of sweeping through v_catalog.views + tables, and doing export_objects.
But I'm not sure entirely what to do with the users+grants+roles table...especially on the password side of things.
Has anybody done this kind of "dump/extraction" before? Is there an existing script out there? Is this something "vbr.py" can do in some form or another?
Any thoughts/advise would be appreciated.
Thanks
We have a leased physical box I need to get off of. It runs Vertica 6.1.1.
We will be migrating to another 1 noder - and then eventually a 3 node cluster.
The developers don't have any schemas, user ids, permission, etc backed up in files. I'm hoping to reverse engineer the system tables to grab table definitions, schema and load it on to the new box.
I figure script kind of sweeping through v_catalog.views + tables, and doing export_objects.
But I'm not sure entirely what to do with the users+grants+roles table...especially on the password side of things.
Has anybody done this kind of "dump/extraction" before? Is there an existing script out there? Is this something "vbr.py" can do in some form or another?
Any thoughts/advise would be appreciated.
Thanks
0
Comments
Even with that said - i kind of want to keep the user ids/schema (and specific schema maybe) in synch between what will be prod and dev. Running vbr.py everything time may be an overkill.
Open to suggestions/different implementations. I kind of dont need the data as much as I need everything else (i.e schema permissions. user ids, views, etc.)
Thanks!
One thought -- have you looked at the meta-function "select export_objects(...)"?
https://my.vertica.com/docs/5.1.6/HTML/index.htm#12721.htm
This won't get you data. (Though you can get data using COPY FROM VERTICA.) But it will get most catalog metadata.
Adam
Luckily we caught it before it could wreak havoc, but that was interesting. We made a note to use "default now()" for the future.
Transporting data with id fields were ugly and we had to customize stuff. No matter how much I hate identity fields, developers will continue to use it so I figure I'll have get comfortable with "vbr.py".
Never figured out how to successfully grant schema permissions + user ids + passwords - we recreated this from scratch with some minor hiccups based off how we saved this data into a file. Once again assume vbr.py is the way to go but would have been nice to run a SQL statement and grab this stuff like the relational DBs provide.
Hi aseering, suggested fix to use export_objects does not give sql statements to grant all privileges for given table.
Is there a way to do that ?
The export function will not bring the privs with it! , for this use Doug Harmon script to extract the privs see article at http://datadug.com/how-to-script-out-users-roles-and-permissions-in-vertica/