How does Odoo select the database when starting? - odoo

I'm confused about how Odoo selects the database to use when starting the server.
I have a few databases. The database todo is the database that I'm using to develop my application. The only app that I have installed in the todo database is my todo app. I started my server through PowerShell (I'm on Windows) using ./odoo-bin.exe -d todo -u todo_app --test-enable From my understanding, this should start the server using the todo database. However, when I look at odoo.log, I see a bunch of tests running from other apps that aren't installed in the todo database. Those apps and tests are installed in a different database.
If I go to /web/database/selector and select my todo database, then restart my server, it works as expected with only the tests in my todo database running, and only the todo app showing as being installed on the Odoo web page.
It seems like Odoo is ignoring the -d flag to odoo-bin and always using the last database that I selected through the web page.
Is that how it's supposed to work and am I wrong about how the -d flag works?
How do I get Odoo to select its database from odoo-bin rather than having to go to /web/database/selector change databases after starting the server?

-d flag doesn't mean select automatically that database it tells odoo to create that database if it's not there and run upgrade on todo if it's installed (-u todo).
You can use dbfilter option to use only one database. Example:
--db-filter='todo'
I'm on my phone sorry for my short answer

Related

Automating Zope5 Database Pack

I tried asking on the Plone forums but no one had any good responses.
I am running Zope5, no ZeoServer, no Plone, with Apache as a frontend proxy.
In the old Zope2 there was a script called zodb-pack that could pack the database from the command line. This is no longer included with Zope5 and I am searching for a way to pack the db from the command line.
Also, Apache is setup for client certificate authentication, so I cannot do something like:
curl -X POST https://username:password#zope.domain.com
I also don't want to hardcode that type of curl statement because of the need to include the username and password.
My Zope is running in a Docker container, so I thought about doing something like:
source /zope5/bin/activate
python scriptname
with a python script along the lines of
from ZODB.DB import DB
from ZODB.config import databaseFromString
from transaction import commit
db = databaseFromString("<zodb_config>")
storage = db.storage
storage.pack(None, referencesf)
but I'm not sure that's the correct way to do this. Basically I just want my bash script that automates the backups for the server to pack the Zope DB before backing it up, but I need a command line command to do so.
I cannot use any solution that requires me to modify how Zope runs, nor requires me to stop Zope to perform the pack.
Of course I can manually go to the ZMI's Control Panel and click Pack, but like I said, I was trying to automate it so it could run in off peak hours.

How to create a login on a test server without active directory domain?

I'm trying to create a login on our test server with:
CREATE LOGIN [<DOMAIN>\<LOGIN>] FROM WINDOWS;
GO
As opposed to the live server the test server does not have any active directory. So it fails with:
Windows NT user or group 'DOMAIN\LOGIN' not found. Check the name again.
Worth to be mentioned, that on the test server we use a backup of a database dump from the last release and apply new migrations to this dump. This means, that this error would not occur, if a more recent dump from the live server was used, where the active directory login already exists.
To enable proper testing, we discussed three possible options:
Recreate the active directory on the test server: I would like to avoid this, because nobody really wants to administer an additional active directory clone for testing purposes.
Use a more recent database dump: The problem here is, that the live server is not ours and we only have restricted access to it. It is possible, but still not the optimal solution in regard to practicability. Also, it would mean, that we would play in migrations to the live server before having tested them on the test server.
Alternative SQL syntax: I am aware, that there alternative ways of creating logins, e.g., CREATE LOGIN <login_name> WITH PASSWORD. But I could not think of any way, which allows us to create logins depending on which system we are on.
Option 3 is our strong favorite, but we are missing a piece to the puzzle. Anything we are missing here?
You can create a new user on your local computer.
And then add this new user to the instance.
CREATE LOGIN [<domainName or your hostName>\<login_name>] FROM WINDOWS;

Unable to connect to WLADM

I am trying to install and setup MobileFirst. SO i was able to install WAS ND, create a server, Install Mobilefirst Server, Install database, Create database and now i am trying to create a runtime with the configuration tool.
Below is the Database screenshot which proves that the database exist
This is a screenshot of the creating admin configuration and also it show that the port number is ok
This is a screen shot of the database additional extra setting which is checking for the database WLADM70 which i have given, validation happened without problem but its always in the checking for the database state.

I can't create apache derby DB in worklight 6.0

I upgraded to worklight 6.0. I added both derby_core_plugin_10_8_2, derby_iu_doc_plugin_1.1.3, into eclipse-->plugins I restarted Eclipse and right click my project to add Apache Derby nature...nothing seems to happened, then I tried to go directly to server/java-->apache derby--> run SQL Script using "ij"...I get (the selected project does not have Apache derby nature please add it and try again)
Your question needs more clarity...It is unclear what you are actually trying to accomplish.
If you're trying to get worklight to run using a Derby database, then you have to modify your worklight.properties file with the following
wl.db.url=jdbc:derby:${worklight.home}/derby/WorklightDB;create=true
wl.db.username=dbusername
wl.db.password=dbpassword
If you're trying to call an SQL adapter to connect to a Derby database, then you'll need to post more information in order for us to see what it is that isn't actually working.

database implementation in php yii framework

I am using phpmyadmin mysql database for yii framework but i cant create a new app using command prompt, instead i go on
c:\xampp\htdocs\yiiframework\framework\yiic\webapp ..\\..\\yiitestapp
and then cmd opens and it asks for yes/no. my cmd does not works
I have already set my environment variables to c:\xampp\php
Please reply how would I create a new app with database table using phpmyadmin.
from your comments i came to know that you are using windows, wamp server package
in your local m/c
based on this assumption
you can use
http://localhost/phpmyadmin/
to create your database
create edit and delete tables
then use
http://localhost//*yor web application name*/?r=gii
to access gii tools
pls let me know if any problem persist