<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: how to migrate Hive data over to new cluster? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97487#M10909</link>
    <description>&lt;P&gt;&lt;A href="https://community.hortonworks.com/users/140/nsabharwal.html"&gt;Neeraj Sabharwal&lt;/A&gt; This is great for fetching all tables from Mysql, however, To avoid Error "FAILED: SemanticException [Error 10001]: Table not found Table Name" &lt;/P&gt;&lt;P&gt;The following would work.&lt;/P&gt;&lt;PRE&gt;mysql -u hive -p -e "select concat( 'show create table ' , T.NAME , '.', T.TBL_NAME,';') from (select DBS.NAME, TBLS.TBL_NAME from TBLS left join DBS on TBLS.DB_ID = DBS.DB_ID) T" hive &amp;gt; /tmp/file.ddl
##remove header in file.sql
hive -f /tmp/file.ddl &amp;gt; tmp/create_table.ddl
&lt;/PRE&gt;</description>
    <pubDate>Sun, 22 Nov 2015 04:26:36 GMT</pubDate>
    <dc:creator>smayani</dc:creator>
    <dc:date>2015-11-22T04:26:36Z</dc:date>
    <item>
      <title>how to migrate Hive data over to new cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97481#M10903</link>
      <description>&lt;P&gt;We have a Old Cluster with HDP 2.0.6 (Hive 0.12.0).. New Cluster with HDP 2.3.2 (Hive 1.2.1). We need to hive query the same tables in new environment and old environment after data forklift in same manner (implying database names, partitioning, etc. work). We migrated all the hdfs data over using distcp.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2015 06:04:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97481#M10903</guid>
      <dc:creator>smayani</dc:creator>
      <dc:date>2015-11-21T06:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to migrate Hive data over to new cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97482#M10904</link>
      <description>&lt;P&gt;If its just a migration, you can make a copy of your old database and then point the HDP 2.3.2 cluster to the copy of your old database. Before starting the Hive services upgrade the hive database by using &lt;A href="https://cwiki.apache.org/confluence/display/Hive/Hive+Schema+Tool"&gt;schemaTool&lt;/A&gt;. You can use &lt;A href="https://cwiki.apache.org/confluence/display/Hive/Hive+MetaTool"&gt;metatool&lt;/A&gt; to update the HDFS locations to the new cluster. Start the hive services.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2015 07:33:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97482#M10904</guid>
      <dc:creator>deepesh1</dc:creator>
      <dc:date>2015-11-21T07:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to migrate Hive data over to new cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97483#M10905</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/220/smayani.html" nodeid="220"&gt;@Saumil Mayani&lt;/A&gt;HDP2.3.2 has Hive 1.2.1? Did you mean HDP 2.2.x or HDP2.3.x?&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2015 10:24:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97483#M10905</guid>
      <dc:creator>pardeep_kumar</dc:creator>
      <dc:date>2015-11-21T10:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to migrate Hive data over to new cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97484#M10906</link>
      <description>&lt;P&gt;yes @Pradeep, you are right .. It is hdp 2.3.2 &amp;amp; hive 1.2.1&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2015 10:31:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97484#M10906</guid>
      <dc:creator>smayani</dc:creator>
      <dc:date>2015-11-21T10:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to migrate Hive data over to new cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97485#M10907</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/222/deepesh.html" nodeid="222"&gt;@Deepesh&lt;/A&gt; yes finally I was able to migrate using similar steps of db backup, restore &amp;amp; point. I will update the steps soon. Only applicable in clean env. Doesn't seem to be a clean approach in case there is already pre-existing database  &amp;amp; tables in hive . We should have a way to extract ddl scripts for all tables / database either from MySQL or hive &amp;amp; run it on new env in hive.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2015 10:51:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97485#M10907</guid>
      <dc:creator>smayani</dc:creator>
      <dc:date>2015-11-21T10:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to migrate Hive data over to new cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97486#M10908</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/220/smayani.html" nodeid="220" target="_blank"&gt;@Saumil Mayani&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you want to get ddl of tables &lt;/P&gt;&lt;PRE&gt;mysql -u hive -p -e " select concat(  'show create table ' , TBL_NAME,';') from TBLS" hive &amp;gt; file.sql  
remove header in file.sql
hive -f /tmp/file.sql
&lt;/PRE&gt;&lt;P&gt;Details&lt;/P&gt;&lt;P&gt;[root@phdns02 ~]#&lt;/P&gt;&lt;P&gt;Table names&lt;/P&gt;&lt;P&gt;login to mysql &lt;/P&gt;&lt;P&gt;use hive;&lt;/P&gt;&lt;P&gt;select concat(  'show create table ' , TBL_NAME,';') from TBLS;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;mysql -u hive -p -e " select concat(  'show create table ' , TBL_NAME,';') from TBLS" hive &amp;gt; file.sql&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="548-screen-shot-2015-11-20-at-101152-pm.png" style="width: 1664px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/23962i1A69724F328C645A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="548-screen-shot-2015-11-20-at-101152-pm.png" alt="548-screen-shot-2015-11-20-at-101152-pm.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You can add above output in shell and run this&lt;/P&gt;&lt;P&gt;[root@phdns02 ~]# su - hive&lt;/P&gt;&lt;P&gt;[hive@phdns02 ~]$ hive -f /tmp/h.ddl&lt;/P&gt;&lt;P&gt;WARNING: Use "yarn jar" to launch YARN applications.&lt;/P&gt;&lt;P&gt;Logging initialized using configuration in file:/etc/hive/2.3.4.0-3276/0/hive-log4j.properties&lt;/P&gt;&lt;P&gt;OK&lt;/P&gt;&lt;P&gt;CREATE TABLE `hadoop`(&lt;/P&gt;&lt;P&gt;  `name` string)&lt;/P&gt;&lt;P&gt;ROW FORMAT SERDE &lt;/P&gt;&lt;P&gt;  'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' &lt;/P&gt;&lt;P&gt;STORED AS INPUTFORMAT &lt;/P&gt;&lt;P&gt;  'org.apache.hadoop.mapred.TextInputFormat' &lt;/P&gt;&lt;P&gt;OUTPUTFORMAT &lt;/P&gt;&lt;P&gt;  'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'&lt;/P&gt;&lt;P&gt;LOCATION&lt;/P&gt;&lt;P&gt;  'hdfs://phdns01.cloud.hortonworks.com:8020/apps/hive/warehouse/hadoop'&lt;/P&gt;&lt;P&gt;TBLPROPERTIES (&lt;/P&gt;&lt;P&gt;  'transient_lastDdlTime'='1448062564')&lt;/P&gt;&lt;P&gt;Time taken: 2.045 seconds, Fetched: 12 row(s)&lt;/P&gt;&lt;P&gt;OK&lt;/P&gt;&lt;P&gt;CREATE TABLE `ns`(&lt;/P&gt;&lt;P&gt;  `name` string)&lt;/P&gt;&lt;P&gt;ROW FORMAT SERDE &lt;/P&gt;&lt;P&gt;  'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' &lt;/P&gt;&lt;P&gt;STORED AS INPUTFORMAT &lt;/P&gt;&lt;P&gt;  'org.apache.hadoop.mapred.TextInputFormat' &lt;/P&gt;&lt;P&gt;OUTPUTFORMAT &lt;/P&gt;&lt;P&gt;  'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'&lt;/P&gt;&lt;P&gt;LOCATION&lt;/P&gt;&lt;P&gt;  'hdfs://phdns01.cloud.hortonworks.com:8020/apps/hive/warehouse/ns'&lt;/P&gt;&lt;P&gt;TBLPROPERTIES (&lt;/P&gt;&lt;P&gt;  'transient_lastDdlTime'='1448062211')&lt;/P&gt;&lt;P&gt;Time taken: 0.067 seconds, Fetched: 12 row(s)&lt;/P&gt;&lt;P&gt;[hive@phdns02 ~]$ &lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 12:47:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97486#M10908</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2019-08-19T12:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to migrate Hive data over to new cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97487#M10909</link>
      <description>&lt;P&gt;&lt;A href="https://community.hortonworks.com/users/140/nsabharwal.html"&gt;Neeraj Sabharwal&lt;/A&gt; This is great for fetching all tables from Mysql, however, To avoid Error "FAILED: SemanticException [Error 10001]: Table not found Table Name" &lt;/P&gt;&lt;P&gt;The following would work.&lt;/P&gt;&lt;PRE&gt;mysql -u hive -p -e "select concat( 'show create table ' , T.NAME , '.', T.TBL_NAME,';') from (select DBS.NAME, TBLS.TBL_NAME from TBLS left join DBS on TBLS.DB_ID = DBS.DB_ID) T" hive &amp;gt; /tmp/file.ddl
##remove header in file.sql
hive -f /tmp/file.ddl &amp;gt; tmp/create_table.ddl
&lt;/PRE&gt;</description>
      <pubDate>Sun, 22 Nov 2015 04:26:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97487#M10909</guid>
      <dc:creator>smayani</dc:creator>
      <dc:date>2015-11-22T04:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to migrate Hive data over to new cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97488#M10910</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/220/smayani.html" nodeid="220"&gt;@Saumil Mayani&lt;/A&gt; nice! Def deserve upvote.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2015 19:59:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97488#M10910</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2015-11-23T19:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to migrate Hive data over to new cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97489#M10911</link>
      <description>&lt;P&gt;In case of oracle metastore , the query would to run from SQL Developer or TOAD would be :&lt;/P&gt;&lt;P&gt;SELECT 'show create table' || dbs.name || '.' || tbls.tbl_name || ';'
  FROM tbls LEFT JOIN dbs ON tbls.db_id = dbs.db_id&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2016 01:15:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97489#M10911</guid>
      <dc:creator>ashok_padmanabh</dc:creator>
      <dc:date>2016-05-05T01:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to migrate Hive data over to new cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97490#M10912</link>
      <description>&lt;P&gt;Does this include View DDLs?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2017 13:09:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97490#M10912</guid>
      <dc:creator>ekanthb</dc:creator>
      <dc:date>2017-02-21T13:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to migrate Hive data over to new cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97491#M10913</link>
      <description>&lt;P&gt;Do we have a way to generate the DDLs for hive databases ?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 23:24:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-migrate-Hive-data-over-to-new-cluster/m-p/97491#M10913</guid>
      <dc:creator>writetoaditikum</dc:creator>
      <dc:date>2017-06-05T23:24:27Z</dc:date>
    </item>
  </channel>
</rss>

