Salesforce - How to Deploy between Environments (Sandboxes, Live etc)

后端 未结 7 573
暗喜
暗喜 2021-02-02 09:54

We\'re looking into setting up a proper deployment process.

From what I\'ve read there seems to be 4 methods of doing this.

  1. Copy & Paste -- We don\'t w
7条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-02 10:46

    I can speak to this from recent painful experience.

    Packaging: this is a very old method that predates the metadata API on which both Ant and Eclipse rely. In our experience, packaging's only benefit is in defining your project. If you're using Eclipse (which we do, and I recommend), you can define your project as being based on a particular package. As long as you remember to add new components to your package, your project hangs together

    One thing that baffled us for a while, btw, are the many uses of package. We've noted the following:

    Installed packages: these come in managed and unmanaged flavors and are really, in the words of a recent post on the SFDC boards, for ISVs to deploy their stuff into various unknown orgs "out there". Both managed and unmanaged packages have limitations that make them unsuitable and unneeded for deployment from development to production within an org, or in any case where you're doing custom development and don't intend to distribute code to a large anonymous base.

    Non-installed packages: this is what you see when you click "Packages" in the web UI. These, that we sometimes call "development packages", seem to be just a convenient way to keep a project definition together.

    Anyway, the conclusion I'm coming toward is that our team (custom development, not an ISV) does not need packages in any form.

    The other forms of deployment, both Eclipse and Ant, rely on the Metadata API. In theory they are capable of exactly the same things. In reality they appear to be complementary. The Force.com migration tool, built into the Force.com IDE for Eclipse, makes deployment as easy as it can be (which is not very) and gives you a nice look at what it intends to deploy. On the other hand, we've seen Ant do some things the IDE could not. So it's probably worthwhile to learn both.

    The process we're leaning toward is to keep all our projects in SVN, and use the SVN structure as the project definition (Eclipse will work with this and respect it). And we use Eclipse and sometimes Ant for migration. No apparent need for packages anywhere.

    By the way, one more thing to be aware of -- not all components are migratable. Some things must be reconfigured by hand in the target environment. One example would be time-based workflows. Queues and Groups also need to behand-created, I think. Likewise the metadata API can't directly process field deletions so if you deleted a field in your source, you need to delete it by hand in the target. There are other cases as well.

    Hope that's useful --

    -- Steve Lane

提交回复
热议问题