32

Downloaded and took a brief look at the Force.com IDE 2 (Beta) this morning that layers on top of the Salesforce CLI (Beta).

As someone with many existing projects containing files that have been through many version control revisions (that I need to keep), I'm wondering how to handle the change to the layout of the files now that (it appears) the src folder is gone as are the component type folders. I did see Convert the Metadata API Source.

Any thoughts or strategies (on how to keep the revision history) appreciated.

PS

The change from Eclipse tooling to IntelliJ (Android Studio) tooling required similar changes for Android projects. This Migrating Git repo from Eclipse to Android Studio suggests the sort of process needed.

PPS

I think I'm looking for an sfdx plugin that instead of doing a convert:

sfdx force:mdapi:convert --rootdir <retrieve dir name>

runs a series of git mv commands.

10
  • Git does actually track files based on their contents, not on their location. So if the content is not changed, it will probably automatically detect it as a move. Have you tried that? Oct 6, 2017 at 10:57
  • @WillemMulder Oh, I would have thought Git would track based on the full file path (including directories). I'm not working on this at the moment but will check that.
    – Keith C
    Oct 6, 2017 at 13:50
  • @KeithC I'm really interessted in your solution if you already found one. Loosing years of Github history is may main roadblock for trying DX with existing packages. Nov 8, 2017 at 9:14
  • @RobertSösemann I haven't managed to get back to this. My next step would be to try to migrate a mall project: maybe there is a simple solution...
    – Keith C
    Nov 8, 2017 at 9:35
  • 1
    @RobertSösemann Sure I'll +1 it; if you call out which bits you have checked and which you haven't I'll accept it too. Hopefully you'll be able to cover the subject more broadly via your salesforce.stackexchange.com/questions/198190/… question.
    – Keith C
    Nov 8, 2017 at 14:16

2 Answers 2

7

If the changes are not to complicated Git is able to recognized files moves without explicitly calling git mv as described here https://stackoverflow.com/questions/433111/how-to-make-git-mark-a-deleted-and-a-new-file-as-a-file-move.

I tested this myself using our internally used packaged travel expense app. A few month ago I was taking part in the DX Pilot and used

sfdx force:mdapi:convert --rootdir <retrieve dir name>

to convert the structure. Here is the commit which shows that all moves where recognized. I later reverted the structure back and the history of files is still there, across all the changes.

enter image description here

0

For anyone else starting from SVN as we were...

One of my colleagues has spent several weeks working on a migration of a large (1000+ class) managed package project from SVN/MDAPI to Git/SFDX. To keep the version history he ran a big AWS instance for over 24 hours to convert all the SVN commits (about 10,000) into Git commits.

Now that he has the process well defined, we plan to migrate further managed package projects. We will code freeze for a week to get each done; most of that is waiting time.

Bottom line: it's a big job to make the move and keep the version history.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .