How to force disable staging via Groovy script


  • If a customer clones a remote staging environment live site the customer will not be able to disable staging. Disable can be forced via Groovy Script.


  • Portal 6.2


  • First get the site ID. Go to Admin > Configuration. Take note of the Site ID value.
  • To execute the script go to Admin > Control Panel > Server administration > Script tab
  • Select Groovy on the Language drop-down menu.
  • Erase all box content and put:
import com.liferay.portal.service.GroupLocalServiceUtil;

long liveGroupId = [SiteID];

 System.out.println("Staging disabled.");

}catch(Exception e){

 System.out.println("Could not disable staging.");

  • Be sure to replace [SiteID] with the Site ID vale noted.
  • Click on Execute

Additional Information

  • On the logs it should appear:
    Staging disabled.
0 人中有 0 人觉得有帮助