Use the Manage databases link in this section to create a new database, openerp_ch01 . This database will contain the demonstration data provided with OpenERP and a large proportion of the core OpenERP functionality. You will need to know your super administrator password for this – or you will have to find somebody who does have it to create this database.
The Super-administrator Password
Anyone who knows the super-administrator password has complete access to the data on the server – able to read, change and delete any of the data in any of the databases there.
After first installation, the password is admin. This is the hard-coded default, and is used if there is no accessible server configuration file. If your system has been set up so that the server configuration file can be written to by the server, then you can change the password through the client. Or you could deliberately make the configuration file read-only so that there is no prospect of changing it from the client. Either way, a server systems administrator can change it if you forget it.
So if your system is set to allow it, you can change the superadmin password through the client by using the Send reset password link by email button of user form
The location of the server configuration file is typically defined by starting the server with the --config command line option.
Creating the Database¶
Use the Manage databases link , Databases ‣ Create in the menu. Enter the super-administrator password, then the name of the new database you are creating.
At the time of creation database you can see the checkbox that determines whether you load demonstration data or not. The consequences of checking this box or not affect the whole use of this database.
You will also see that you can choose the Administrator password. This makes your database quite secure because you can ensure that it is unique from the outset. (In fact many people find it hard to resist admin as their password!)
Wait for the message showing that the database has been successfully created, along with the user accounts and passwords (admin/XXXX and demo/demo ). Now that you have created this database, you can extend it without having to know the super-administrator password.
The combination of username/password is specific to a single database. If you have administrative rights to a database you can modify all users.
Alternatively, you can install the users_ldap module, which manages the authentication of users in LDAP (the Lightweight Directory Access Protocol, a standard system), and connect it to several OpenERP databases. Using this, many databases can share the same user account details.
Failure to Create a Database
How do you know if you have successfully created your new database? You are told if the database creation has been unsuccessful. If you have entered a database name using prohibited characters (or no name, or too short a name), you will be alerted by the dialog box Bad database name! explaining how to correct the error. If you have entered the wrong super-administrator password or a name already in use (some names can be reserved without your knowledge), you will be alerted by the dialog box Error during database creation!.
As a super-administrator, you do not only have rights to create new databases, but also to:
All of these operations can be carried out from the Manage Database Login screen.
Backup (copy) a Database
To make a copy of a database, go to the web Login screen and click the Manage Databases button. Then click the Backup button, select the database you want to copy and enter the super-administrator password. Click the Backup button to confirm that you want to copy the database.
Drop (delete) a Database
To delete a database, go to the web Login screen and click the Databases button. Then click the Drop button, select the database you want to delete and enter the super-administrator password. Click the Drop button to confirm that you want to delete the database.
Restore a Database
To restore a database, go to the web Login screen and click the Manage Databases button. Then click the Restore button, click the Choose File button to select the database you want to restore. Give the database a name and enter the super-administrator password. Click the Restore button to confirm that you want to install a new copy of the selected database. To restore a database, you need to have an existing copy, of course.
Duplicating a Database
To duplicate a database, you can:
make a backup file on your PC from this database.
restore this database from the backup file on your PC, and give it a new name.
This can be a useful way of making a test database from a production database. You can try out the operation of a new configuration, new modules, or just the import of new data.
A system administrator can configure OpenERP to restrict access to some of these database functions so that your security is enhanced in normal production use.
You are now ready to use databases from your installation to familiarize yourself with the administration and use of OpenERP.
New OpenERP Functionality¶
The database you have created and managed so far is based on the core OpenERP functionality that you installed. The core system is installed in the file system of your OpenERP application server, but only installed into an OpenERP database as you require it, as is described in the next chapter, Guided Tour.
What if you want to update what is there, or extend what is there with additional modules?
To update what you have, you would install a new instance of OpenERP using the same techniques as described earlier in this section, Database Creation.
To extend what you have, you would install new modules in the addons directory of your current OpenERP installation. There are several ways of doing that.
In both cases you will need to be a root user or Administrator of your OpenERP application server.
To extend OpenERP you will need to copy modules into the addons directory. That is in your server's openerp-server directory (which differs between Windows, Mac and some of the various Linux distributions and not available at all in the Windows all-in-one installer).
If you look there you will see existing modules such as product and purchase. A module can be provided in the form of files within a directory or a a zip-format file containing that same directory structure.
You can add modules in two main ways – through the server, or through the client.
To add new modules through the server is a conventional system administration task. As root user or another suitable user, you would put the module in the addons directory and change its permissions to match those of the other modules.
To add new modules through the client you must first change the permissions of the addons directory of the server, so that it is writeable by the server. That will enable you to install OpenERP modules using the OpenERP client (a task ultimately carried out on the application server by the server software).
A very simple way of changing permissions on the Linux system you are using to develop an OpenERP application is to execute the command sudo chmod 777 <path_to_addons> (where <path_to_addons> is the full path to the addons directory, a location like /usr/lib/python2.5/site-packages/openerp- server/addons).
Any user of OpenERP who has access to the relevant administration menus can then upload any new functionality, so you would certainly disable this capability for production use. You will see examples of this uploading as you make your way through this book.