Support Questions

Find answers, ask questions, and share your expertise

Backup specific Hive table

avatar
Contributor

Hi,

I am able to backup all my hive tables by backuping the HDFS folder /apps/hive/warehouse and the MySQL database (mysql dump and restore).

How can I backup some Hive tables only? for HDFS files it's easy. But how can I backup/restore the metadata from MySQL for only those tables ?

Cheers!

Joe

1 ACCEPTED SOLUTION

avatar

Hi @Joe Harvy

You can create scripts that will create the databases and tables based off the Hive metastore. This blog walks you through the step.

https://sharebigdata.wordpress.com/2016/06/12/hive-metastore-internal-tables/

View solution in original post

3 REPLIES 3

avatar

Hi @Joe Harvy

You can create scripts that will create the databases and tables based off the Hive metastore. This blog walks you through the step.

https://sharebigdata.wordpress.com/2016/06/12/hive-metastore-internal-tables/

avatar
Expert Contributor

Great post @Scott Shaw

The partial backup/restore of Hive metastore can be a good new feature for Hive.

In general Hive Metastore is shared by many projects/teams , and at the moment we are unable to restore the metadata for one team ( only few tables ) without impacting the others.

avatar
Rising Star

One another way to backup/restore specific hive tables would be to use 'show create table' to back up DDL which could be used to recreate the table. Then the saved hdfs files could be dropped to warehouse dir to finish the table restore.

beeline -u jdbc:hive2://<cluster-name>:<port#>/<db-name> --outputformat=csv -e "show create table <table-name>;" > <table_name>.ddl