legacy-knowledge-base
公開されました 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

learn-legacy-article-disclaimer-text

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