
7Cogs Sample Data
Introduction #
Liferay versions 5.2 and 6.0 include some sample data in the bundles to showcase Liferay Portal's capabilities. You will find several users, organization and web pages already created belonging to a fictitious company called 7Cogs.
If you play around with the default installation, you shouldn't delete the administrative user bruno, as his existence is used by the 7cogs plugin to check if it was already installed. If - on a new start of the browser - this plugin can't find bruno, it will happily recreate the initial demonstrative database and delete all your work.
This article helps getting rid of this behaviour and enables you to keep your data without the need for Bruno to stick around forever.
Starting in Liferay 6.0.5 and forward, Bruno is no longer used as the logic for deleting everything. Still, do remember to delete the 7Cogs hook before using any production installation environment.
Remove the sample data #
To remove the sample data that is included in the bundle follow these steps:
1. Go to the Control Panel > Plugin Installation, search for sevencogs-hook and remove it.
In case you can't find it there, remove the application from the server. (For example, if you are using tomcat, remove the folder 7cogs in webapps).
Important Note: some application servers may not support hot undeploy using this method. In those cases follow the instructions of your application server to undeploy sevencogs-hook.war
For example for Tomcat, if the above doesn't work, go to your file manager and navigate to liferay-portal-5.2.2\tomcat-5.5.27\webapps
2. Stop the Liferay Portal server
3. Delete the data in your database or point to a new database. The exact steps will depend on the database you are using. Here are the exact instructions for some common ones:
3.1 If you're using Hypersonic, which is the default db, this should work.
- Shut down the application server (For example, in Tomcat for windows double-click shutdown.bat.)
- Go to your file manager
- Navigate to liferay-portal-5.2.2\data\hsql
- Delete lportal.properties and lportal.script.
- Start up Liferay again using the startup.bat.
3.2 If you're using mysql it's console and delete the database and create it again executing the following SQL:
drop database lportal; create database lportal character set utf8;
3.3 For other server based databases follow the same instructions as for MySQL but adapt the create SQL sentence to the specific db. Look the SQL script provided with Liferay for your specific database for further details.
4. Start the Liferay Portal server
5. Use a browser to access the server and login using the following credentials:
- E-mail: test@liferay.com
- Password: test
Install the sample data #
In order to install the sample data again, just access the Control Panel > Plugin Installation and install the plugin called 7 Cogs. (Only for versions above 5.2)
(Re-)Initialization of a(n existing) database#
Note: Be careful, as installing the 7cogs plugin will remove all data existing in your database
Careful: As said above: When this plugin is installed (as is the case in the default bundle download), deleting the user bruno will cause the plugin to re-initialize the database upon next start of the server. This applies to startups with the plugin being already installed, not just upon the act of installing it! You have been warned.