Duplicate a component file

I have a design for one project but I want to use the same design for another project with a few changes to it. I created a lot of components in the first file but when I duplicate this files all the components are still referring to the main component in the original file. How can I make all the instances of this duplicated file refer to the component in the duplicated file and not the original file. I don’t wanna detach the components which will make me to create all the variants again.