Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

HomeDev GuideRecipesAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Smooth rebuild

How to smooth rebuild Optimizely Graph account functionality.

📘

Note

This topic is for CMS administrators and developers with administrative access rights.

You can start a smooth rebuild when you need to:

  • Re-sync all content and content types for your data source.
  • Perform this re-sync in the background without any downtime to your live service.
  • Verify the rebuilt data source in a new slot before it goes live.
  • Ensure that once verified and swapped, the changes take effect immediately and all subsequent updates are continuously synced.

It is a safe and efficient way to comprehensively refresh or update your Graph data source, ensuring data consistency and continuous service availability.

  1. Go to Settings > Smooth Rebuild. The Graph Data Rebuild window displays.

    • Start a smooth rebuild – The Details window displays (Step 2).
    • Reset to default – Click Reset to default only if you need to completely wipe the data source and start entirely from scratch, perhaps due to corruption or a fundamental change in how you want to configure your data. It permanently removes all synced content and content types and makes the service unavailable.
  2. Click Start. A Status displays above the Start and Stop buttons.

  3. When the rebuild is complete, click Accept or Abandon.

    Click Abandon to discard the new slot and its rebuilt data, leaving your current data source unchanged. Click Abandon if, after verifying the rebuilt data source in the new slot, you decide not to proceed with making it live. This could be because:

    • You found issues or errors during your verification of the new slot.
    • The rebuilt data source doesn't meet your expectations or requirements.
    • You have changed your mind and prefer to stick with the original data source.
  4. Click Accept. The new slot displays on the Graph Data Rebuild window. You can still change your mind and revert to its previous state.

Smooth rebuild process

  • After clicking Start, the Status changes from IDLE to RUNNING.
  • Optimizely Graph creates a new deployment slot, and the system syncs the CMS database to the new slot.
  • You can initially test the new slot but it may have missing content.

After the data sync from the CMS database is completed at least once, the status changes to DELTA SYNCING. This means any changes since you started the rebuild is also synced to the new slot.

Hard reset Optimizely Graph

Use hard reset (reset account) functionality when in development and can afford maintenance windows or downtime. A hard reset deletes your indexed data that the Optimizely Graph service uses to retrieve results and lets you start from a default state, which can help sync content faster.

This is helpful when

  • your Optimizely Graph tenant syncs with multiple sites with different content and content types
  • your data models have significantly changed.

The hard reset removes indexes and creates new standard indexes for the current tenant.

🚧

Important

Hard resetting the account deletes your indexed data and is not a routine maintenance procedure. After resetting, manually run the Content type indexing job and Content indexing job again.

You can use the CMS Admin UI or a GraphQL call (account mutation) to perform the reset account procedure.

Reset with Content Management System

  1. Go to Settings > Smooth Rebuild. The Graph Data Rebuild window appears.
  2. Click Reset to default, and confirm the reset procedure for the current account.

Use a reset account mutation (advanced)

You can reset your account by sending a GraphQL call to reset the account mutation.

{
    "query": "mutation { resetAccount }"
}

To use reset account mutation, you must use HMAC authentication for data integrity and message authentication. Set your request's confirmation header RemoveAllData to true.

Example using Postman:

  • URL
POST https://cg.optimizely.com/content/v2
  • Headers
RemoveAllData: true
  • Body (JSON)
{
    "query": "mutation { resetAccount }"
}
  • Pre-request Script
var crypto = require("crypto-js");
var sdk = require('postman-collection');
var method = pm.request.method;
var key = "yourProvidedSecret";
var secret = CryptoJS.enc.Base64.parse("yourProvidedSecret");
var target = new sdk.Url(request.url).getPathWithQuery();
var timestamp = (new Date()).getTime();
var nonce = Math.random().toString(36).substring(7);
var body = "";
if( pm.request.body )
{
    body = pm.request.body.raw;
}
var bodybase64 = crypto.MD5(body).toString(CryptoJS.enc.Base64);
var hmac = crypto.HmacSHA256(key + method + target + timestamp + nonce + bodybase64, secret);
var base64hmac = CryptoJS.enc.Base64.stringify(hmac);
var header = "epi-hmac " + key + ":" + timestamp +":" + nonce + ":" + base64hmac;
// Add Authorization header with computed HMAC to the request
pm.request.headers.add({
    key: "Authorization",
    value: header});
  • HMAC keys
var key = "yourProvidedAppKey"
var secret = "yourProvidedSecret"

In the pre-request script, replace yourProvidedSecret and yourProvidedSecret with the corresponding keys from your site's web.config or appsettings.json.

The following is an example of a successful result:

See GraphQL mutation.