How to Rename HBase Table? – Examples

  • Post author:
  • Post last modified:February 28, 2018
  • Post category:BigData
  • Reading time:3 mins read

In earlier, we had a simple script ‘rename_table.rb’, that would rename the HBase hdfs table directory and then edit hbase:meta table replacing all details of the old table name with the new. The script was deprecated and removed as it was un-maintained. In this article, we will check how to rename HBase table using snapshot with some examples.

How to Rename HBase Table

How to Rename HBase Table?

You can use HBase snapshot facility to rename the tables. Here is how you would do it using the HBase shell:

Related reading:

 Step1: Create Snapshot of HBase table that you want to rename

You need to create snapshot to migrate or copy that to different namespace. You must disable the table and then create snapshot.

Step2: Clone Snapshot to new table name

Once table snapshot is created you can clone the snapshot to new table name.

Step3: Use ‘list’ command to check new table

Check new table with list command.

Step4: Delete Snapshot

Once the table is created with new name, you must delete the HBase old table snapshot.

Step5: Drop Original Table

The last step would be to drop the original HBase table.