Using an API tool (such as the Data Loader), you can change the pricebook associated to your Opportunities by following the steps below:
1) If your opportunities have Products associated, you must first delete all the products off the Opportunities. This is required in order to change the pricebook.
a. Do an export on the Opportunity Line Item object for the Opportunities you want to change the Pricebook on. You can use the opportunity IDs in the query to export Line Items from only the desired Opportunities, or export the entire Opportunity Line Item object and do a vlookup for just the desired Opportunity IDs.
b. Delete the Opportunity Line items off the opportunities.
2) Update the Pricebook2ID field on the Opportunities to associate the new Pricebook ID to the opportunities. To find the Pricebook2ID, you can do a an export on the Pricebook2 object.
3) Insert any desired products from the new Pricebook into the Opportunity Line Item object using the Price Book Entry Ids from the PriceBookentry object. Be sure to include the desired Quantity, Prices, etc. when you do the insert into the Opportunity Line item object.
See also:
Insert or update Price Books with Data Loader
OpportunityLineItem insert error 'FIELD_INTEGRITY_EXCEPTION
000387649

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.