Legacy Knowledge Base
Published Jul. 2, 2025

Live site is not editable after Staging site was removed.

Written By

Sebastian Madaras

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

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

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

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

Issue

  • How to recover the default functions on the Live site if your remote Staging site was either deleted or not disabled correctly?

Environment

  • Liferay DXP 7.2

Resolution

  • By running a groovy-script the Live site's default functions can be enabled.
  • Before going further, please create a back-up of your database. As the resolution will make changes to the database, it is necessary to have it saved for security reasons.
  1. Start two vanilla Liferay 7.2 bundles with separate databases.
  2. Create in bundle1 a site called 'Staging' and in bundle2 a site called 'Live'. Connect these via Remote Staging.
  3. Delete in bundle1 --> 'Staging'.
  4. Go to bundle2 --> 'Live'. Here you will notice inside Control Panel --> Content, that you cannot add a new web content article. This is due to the fact that your 'Live' site wasn't disabled from the 'Staging' site. 
  5. In order to be completely sure, please verify your database from bundle2. In your 'Live' site --> 'group_' table verify the 'remoteStagingGroupCout' column. If the value is '0', then the resolution of this article won't help. If the value is '1' then please continue with the next steps.
  6. Navigate to Control Panel --> Configuration --> Server Administration --> Scripts. Here copy and paste the below code and execute it:
import com.liferay.portal.kernel.service.GroupLocalServiceUtil;
long liveGroupId = [SiteID];
try {
GroupLocalServiceUtil.disableStaging(liveGroupId);
println("Staging disabled.");
}
catch(Exception e) {
println("Could not disable staging.");
}

 - In order to actually run the script please replace the '[SiteID]' with the actual SiteID value.

- What this will do is that it will set the 'remoteStagingGroupCout' to the value '0', which means that your specific site is not connected to any other site via Remonte Staging.

Additional Information

  • The above approach can work for Liferay Portal 6.2, Liferay DXP 7.0, and Liferay DXP 7.1. However, the script might require minor changes, due to the package name (com.liferay.portal.kernel.service.GroupLocalServiceUtil) changes from one Liferay version to another. Please feel free to contact the Customer Support team for any questions. 

 

Did this article resolve your issue ?

Legacy Knowledge Base