private void migrate(MasterProcedureEnv env) throws IOException {
    Connection conn = env.getMasterServices().getConnection();
    try (Table nsTable = conn.getTable(TableName.NAMESPACE_TABLE_NAME);
      ResultScanner scanner = nsTable.getScanner(
        new Scan().addFamily(TableDescriptorBuilder.NAMESPACE_FAMILY_INFO_BYTES).readAllVersions());
      BufferedMutator mutator = conn.getBufferedMutator(TableName.META_TABLE_NAME)) {
      for (Result result;;) {
        result = scanner.next();
        if (result == null) {
          break;
        }
        Put put = new Put(result.getRow());
        result
          .getColumnCells(TableDescriptorBuilder.NAMESPACE_FAMILY_INFO_BYTES,
            TableDescriptorBuilder.NAMESPACE_COL_DESC_BYTES)
          .forEach(c -> put.addColumn(HConstants.NAMESPACE_FAMILY,
            HConstants.NAMESPACE_COL_DESC_QUALIFIER, c.getTimestamp(), CellUtil.cloneValue(c)));
        mutator.mutate(put);
      }
    }
  }
Migrate the namespace data to meta table's namespace family while upgrading
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/MigrateNamespaceTableProcedure.java