This question has been flagged
3 Replies
33241 Views

I have created a new database, but cannot find a way to change the default database or switch databases. - Ubuntu Server 12.10 - I Created a new database using the "Manage Databases" link on the login page. - The only choices there are to duplicate or drop or backup or restore. - I cannot find any config file that controls the database name. - I need to keep data in the old database for a while.

The mistake of removing the "service" product is forcing me to move to a clean database. No modules can be added or changed after you remove "service" because it leaves a hole that generates errors.

Thanks, Gary

Avatar
Discard
Best Answer

Incidentally, the error with the deletion of the service product is in fact very simply to correct, you simply have to force an update of the Product module, this will re-create the service product appropriately. We will change the error message to indicate so very soon, and for next version we'll make sure this error is prevented altogether.

As for renaming databases, there is no option in the database management interface to do so directly. If you're not familiar with PostgreSQL and the command-line of your operating system you can achieve this result by doing the following:

  1. Make a backup of your database (e.g. "foo") using the database manager
  2. Restore the backup of your database using the database manager, and choose the new name you wanted, e.g. "foo_new"
  3. After making sure that the freshly restore database works, you can finally drop "foo" using the database manager.

On the other hand if you're familiar with PostgreSQL you can use the pgAdmin interface to rename a database or execute the SQL command that @Andreas Brueckl mentioned, as a PostgreSQL super-user:

ALTER DATABASE foo RENAME TO foo_new;

You don't need to restart OpenERP after doing this, doing a simple logout + login in the new database should be enough.

Finally, you need to know that you won't see the database list on the login screen unless you have more than one database available.

PS: none of the above is specific to v7, by the way, the same applies to v6 or v6.1.

Avatar
Discard
Author

Beg to disagree... I created a second database with Manage Databases as mentioned above and can find it with pgAdmin, But it does Not show up at login as it should. That is why I asked. - Gary

Author

Thanks Oliver, I will try to force an update of the Product file as soon as I research how.

@Gary: the database list in the top-right corner of the login screen, that's where you're looking for it, right?

Author

There is No database list or anything in the top-right corner of the login screen. There only the login center of screen login square with logo and the Manage Databases link below it. I also went back to pgAdmin and I can browse into 3 different databases. I have also tried IE, Chrome & Firefox. None shows a database list.

Author

I just discovered a shortcut for connecting to a database when the database list does not show up. Substitute in the url: db=other_database_name

Author

BTW: Why did someone change the subject on this question to be different then I was asking? I Did Not Ask Anything About Changing the Name of A Database!!

Author

"Egg on Face" - I found my problem with never getting to chose the database. I had not notice that my browser(s) we pre-loading a string when I typed in the IP for the server. I would type the IP & hit enter, but the browser was auto adding "db=openerp" to the url. Thus it was loading the default login with no choice of databases. - Sorry... Gary

I think I modified the question wording because that's how I understood your problem - you can easily change it back or revert my changes. I will do it myself now. BTW if you've found the solution to your problem, you might want to post your own answer (not just a comment) and indicate so, for the record. Thanks

It's not really an answer to the question "How to select a different database on login screen". What IS the answer to that?

Best Answer

in the /etc/openerp/openerp_server.conf

file have you hidden the db listing box (top right of screen)

db_list = False

hides it

db_list = true

reveals it ?

Avatar
Discard
Best Answer

You can change the name of a database directly in PostgreSQL:

ALTER DATABASE name RENAME TO new_name;

After a restart of OpenERP the new database name should be visible.

Avatar
Discard
Author

I am trying to have multiple databases to test data imports for a new customer. pgAdmin lets me browse 3 databases. Rebooting makes no difference. There is no list of databases on the login screen.