I'm trying to create a duplicate of an existing hosted feature layer, but when I do, this layer is then considered a "feature layer", not "hosted". How to convert this feature to a hosted one?

I accomplished this by opening the hosted feature layer in map viewer and then doing save as under a new name. Maybe there is some other way...