Legacy Knowledge Base
Published Jun. 30, 2025

Unable to re-enable Analytics Cloud in Production after disabling the connection in a lower environment with Production backup data

Written By

John Park

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • In a testing scenario in which Production backup data is imported to a lower environment and Analytics Cloud is disabled via the UI in the lower environment, you may observe that the connection gets disabled in Production and that attempting to re-enable it fails.

Environment

  • Quarterly Releases

Resolution

  • In order to keep the Production Analytics Cloud syncing normally and intact, please run the groovy script below to clear the Analytics Cloud connections in the lower environment (with the Production backup data) and do not disable the Analytics Cloud connection via the UI. 
import com.liferay.analytics.settings.configuration.AnalyticsConfiguration;
import com.liferay.portal.kernel.module.configuration.ConfigurationProviderUtil;
import com.liferay.portal.kernel.service.CompanyServiceUtil;
import java.util.Dictionary;
import java.util.Hashtable;
import com.liferay.portal.kernel.module.configuration.ConfigurationProviderUtil;

companyId = 20097; //Update companyId (Check Control Panel > Virtual Instances)

AnalyticsConfiguration analyticsConfiguration = ConfigurationProviderUtil.getCompanyConfiguration(AnalyticsConfiguration.class, companyId);

Dictionary<String, Object> configurationProperties = new Hashtable<>();

ConfigurationProviderUtil.saveCompanyConfiguration(AnalyticsConfiguration.class, companyId, configurationProperties);

CompanyServiceUtil.removePreferences(companyId, (String[])["liferayAnalyticsConnectionType", "liferayAnalyticsDataSourceId", "liferayAnalyticsEndpointURL", "liferayAnalyticsFaroBackendSecuritySignature", "liferayAnalyticsFaroBackendURL", "liferayAnalyticsGroupIds", "liferayAnalyticsProjectId", "liferayAnalyticsURL"]);

Additional Information

  • If any issues arise during this process please open up a Support ticket for further assistance. 
Did this article resolve your issue ?

Legacy Knowledge Base