hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Burley <>
Subject Re: Alter table Set Locations for all partitions
Date Mon, 22 Aug 2011 01:51:00 GMT

The following worked for us on a MySQL metastore:

mysqldump metastore > metastore-backup-`date +%Y%m%d`.sql
mysql metastore
UPDATE DBS SET `DESC`=REPLACE(`DESC`, 'hdfs://hadoop-namenode-1',

But I think you noted you are using Derby. If I were using Derby, I'd
switch to MySQL to make the management less painful, and then do the
above. I provided some info on migrating from Derby to MySQL here:

If you must run Derby -- I'd think you could use the same tool,
RazorSQL to load up the metastore and then tweak the underlying data.

Good Luck!


On Fri, Aug 19, 2011 at 5:26 PM, Bhupesh Bansal <> wrote:
> Hey Folks,
> I am wondering what is the easiest way to migrate data off one hadoop/hive
> cluster to another.
> I distcp all data to new cluster, and then copied the metadata directory to
> new cluster.
> hive comes up fine and show tables etc but the hive location is still
> pointing to old cluster
> There is one command
> alter table table_name set location new_location
> but it doesnt work for partitioned tables, is there a way we can do it for
> *ALL* partitions easily ??
> Best
> Bhupesh
This e- mail message is intended only for the named recipient(s) above. It may contain confidential
and privileged information. If you are not the intended recipient you are hereby notified
that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly
prohibited. If you have received this e-mail in error, please immediately notify the sender
by replying to this e-mail and delete the message and any attachment(s) from your system.
Thank you.

View raw message