Tell me more ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

How do I copy(for want of a better word) metadata (i.e. Objects, Workflows, Validation rule etc), and code (Apex, Visualforce, Triggers) from one Production org to another production org?

Is this even possible? I know that Change Sets won't help here since they work only within an org.

Thanks!

share|improve this question
To help those that come after: This question refers to a one-time deploy if you read through all of the answers below. – Akrikos Apr 23 at 21:46

5 Answers

up vote 14 down vote accepted

You can use the Force.com IDE to do this. Follow the download and installation instructions here: Force.com IDE Installation

Once the Force.com IDE is installed, create a new project and provide the source org's login information and choose all meta-data objects you want to deploy to another org. Once they've all be downloaded into your project, right-click on the project and select "Force.com->Deploy to Server" and the tool will walk you through the process with a wizard.

share|improve this answer
Thanks @E.J.Wilburn ! I have used Force.com IDE to deploy changes from a sandbox to a prod org. But I have never used it deploy code and metadata from one prod org to another. Lets say I have the eclipse project connected to Prod Org 1, can I then just deploy it to Prod Org 2 using the deploy wizard? – Anup Aug 1 '12 at 7:32
Hi @Anup yes you can deploy the metadata and code in that way. The wizard asks for the login details of the target org. It doesn't have to be the same as the one linked to the project. – Born2BeMild Aug 1 '12 at 7:48
Yes. It will work as it does when deploying from sandbox to production. You won't be able to edit any of the components you can't edit via the web UI though, they'll be in read-only mode and saving any changes will result in an error. – E.J. Wilburn Aug 1 '12 at 7:54
Thanks guys! I'll try it out, and let you guys know. – Anup Aug 1 '12 at 8:22
2  
note, if you have selected Profiles in the source project that makes deployment VERY hard because those Profile settings even if you don't select the Profiles to be deployed carry over. e.g. you have a field on a Account that is FLS private for all except a Profile *CustomAdmin...when you try to deploy that custom field it will fail because the destination org doesn't have *CustomAdmin profile. My suggestion - have your project just be config/code/report, etc minus profiles, then in your destination org re-do security as you see fit, or bring over the Profiles too which is harder, but doable. – caleb Aug 1 '12 at 15:01

You can also use the Ant based Force.com Migration Tool:

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_deploying_ant.htm

share|improve this answer
If you are doing the same deployment over and over, I would recommend the migration tool as well. If it is a small number of different files each time, going through the IDE would probably be easier than setting up and modifying the migration tool configuration. – Rob Scott Aug 1 '12 at 20:15
Thanks! This is a one-off migration/cloning process to create a new org using another org as a template. – Anup Aug 2 '12 at 5:51

I should point out that the following items cannot be deployed through Eclipse (at least from what I can find):

  • Approval Workflows
  • Chatter Settings
  • UI Settings
  • Lead Settings
  • Email Settings
  • Organization Settings
  • Outlook Configurations
  • Offline Configurations
  • Mobile Configurations
  • Lead Assignment Rules
  • Case Assignment Rules
  • Custom Object Criteria Based Sharing Rules
  • Content
  • Knowledge
  • Ideas
  • Queues (not positive on this since I know Groups can be deployed now)
  • Time-Dependent Actions (the rules can be deployed, but the time-dependent part needs to be re-created)
  • Email Services
  • Scheduled ApexJobs/Reports/Dashboards
  • OrgWide Email Addresses
  • Renamed Fields/Objects
  • Individual Users Email Signatures, Chatter Settings, Outlook Configuration, Offline Settings, Personal Groups, Update Reminder Settings
  • All Reports, Dashboards or Email Templates that are in a users "My Personal Reports" or "My Personal Templates" folder
  • All Private List Views
  • Anything considered "Data" (with the exception of Documents, which for some reason can be deployed through Eclipse).
share|improve this answer
1  
The full list is here: salesforce.com/us/developer/docs/dev_lifecycle/Content/…. Note that Change Sets actually support less: help.salesforce.com/help/doc/en/changesets_about_components.htm. – Peter Knolle Aug 21 '12 at 9:56
This answer doesn't help except as an addendum to the accepted answer. I'd rather see you also recommend eclipse and then give a caveat or something. I'd upvote that. – Akrikos Apr 23 at 21:45

Another mechanism is to create an unmanaged package. The list of package-able components (from the relevant page in the ISVforce Guide):

  • Analytic Snapshot
  • Apex Class
  • Apex Sharing Reason
  • Apex Sharing Recalculation
  • Apex Trigger
  • Application
  • Article Type
  • Custom Button or Link
  • Custom Field
  • Custom Label
  • Custom Object
  • Custom Report Type
  • Custom Setting
  • Dashboard
  • Document
  • Email Template
  • Field Set
  • Folder
  • Home Page Component
  • Home Page Layout
  • Letterhead
  • List View
  • Page Layout
  • Permission Set
  • Record Type
  • Remote Site Setting
  • Report
  • S-Control
  • Static Resource
  • Tab
  • Translation
  • Validation Rule
  • Visualforce Component
  • Visualforce Page
  • Workflow Email Alert
  • Workflow Field Update
  • Workflow Outbound Message
  • Workflow Rule
  • Workflow Task
share|improve this answer
2  
Note that this don't work very well for copying profiles. The profiles you package aren't full profiles but really "fragments" of them that get merged with the existing profiles in the org you're installing into. Be prepared to re-configure page layouts, FLS, and others when doing this. Especially for the admin profile as you can't even apply a profile "fragment" to it during install for some seemingly arbitrary reason. – ca_peterson Aug 1 '12 at 19:56
Good observations. Thanks, @ca_peterson! – metadaddy Aug 1 '12 at 19:57
This is interesting! I'll definitely check it out. – Anup Aug 2 '12 at 5:51

SnapShot (http://appexchange.salesforce.com/listingDetail?listingId=a0N300000016YhyEAE) can migrate from any Org to any Org (as long as you have admin credentials). This includes migrating profiles, partial profiles - only FLS of one field but not the other etc., objects, workflows etc. You can even edit the profiles to update security settings en masse before migrating it to the destination.

This is a paid app on AppExchange.

Disclaimer: I work for DreamFactory, the makers of SnapShot.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.