Copy a SharePoint 2016 Site Feature and Rename it

I'm trying to duplicate a feature and use the original feature for the live production site - then use the duplicate for a testing site.

How would I go about
   - copying an existing site feature
   - renaming it
   - making it so it is it's own separate feature  (So if the duplicate is changed the original one isn't changed.)

There's only 1 farm.  I've set up a duplicate site to develop with.
The feature is a site feature on the farm that is Active on 1 site.
What I need to do is copy it, rename it and make the copy active on the test site, same farm.    
The new test feature will be modified in the development site.  And while modifying it I don't want it to change the feature on the live site.
Using SharePoint 2016 - On Premise.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jamie McAllister MVPSharePoint ConsultantCommented:
Assuming you don't have the source code;

Download a copy of the WSP from the farm;

Rename the file to .CAB instead of .WSP and extract the contents.

Use a tool such as dot peek to decompile the file;

Build the resuling code back into a valid Visual Studio SharePoint Solution project.

Change all references to the feature name and the GUIDs.

Recompile and deploy.
jshesekAuthor Commented:
Thanks Jamie for your comment.  Sorry didn't respond sooner got pulled away to different projects.

I do have the source code.  The total solution is made up of a .Core file, .EventReceiver  & .TaskReminders
The .EventReciever is the code that calls the .Core & .TaskReminders file

Would like to duplicate & rename them to .CoreStage, .EventRecieverStage & .TaskReminderStage
Then allow the staging site to use these as a feature instead of the originals.   (I know the right way to do this is with another server.  But that's not available.)

Found this:
I've renamed everything and was able to build - but unable to deploy.  
Error is C:\Program Files\MSBuild\Microsoft\VisualStudio\v14.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets(308,5): error MSB3202: The project file "C:\Users\me\Documents\Visual Studio 2015\Projects\EventReceiverStage\Core\Core.csproj" was not found.

I'm new so don't really wan to modify the V14.0 file.  

Any ideas?

Jamie McAllister MVPSharePoint ConsultantCommented:
Yes the editing of names has missed one and the reference to the project file is wrong.

You need to track down that reference to core.csproj and rename it. Most of the files are text, just crack them open and do a search.

If you're not changing anything you won't break it. You're going to do a very targeted edit so no issues.

Keep a copy of the original if you're worried.
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

jshesekAuthor Commented:
Hi Jamie,

Ok changed the file names - and was able to build it.  When I went to deploy it - wouldn't deploy because said there was a feature with duplicate GUID.
As you stated above replace the GUIDs. - Yikes - every one of them?  Do I use some type of GUID generator to create them?

Any way to take the original - backup & restore or export - import to staging site?  Staging is a different site setup with a different pool#.

Jamie McAllister MVPSharePoint ConsultantCommented:
There are a bunch of GUID generators available online etc. Then it's a global find and replace.
I've done this many times.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jshesekAuthor Commented:
Changed the GUIDs and was able to compile and create a .wsp file.
Thanks Jamie
jshesekAuthor Commented:
Thanks Jamie
Your input helped.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.