WSO2 EMM mysql database setup - wso2

I am using WSO2 EMM 1.1.0. The documents talk about using a MySQL instead of H2 https://docs.wso2.com/display/EMM110/Setting+up+MySQL. It talks about editing the master-datasource.xml file and updating the WSO2_CARBON_DB, WSO2_EMM_DB and WSO2AM_DB databases. It then gives steps on priming those db's. But the master-datasource.xml file also contains the WSO2_IDENTITY_DB, SOCIAL_CACHE, SOCIAL_CASSANDRA_DB and JAGH2. I expect all of those can be moved to MySQL as well but I don't see the database scripts to set them up. What is the proper procedures to set up a system that uses MySQL instead of H2? Not to mention that the emm database had the database name hard coded into the setup script "USE WSO2EMM_DB" thus nullifying the master-datasource.xml file.
Thanks,
Brian

It is mentioned in this documentation[1] under the topic 'How to migrate from H2 to MySQL'
[1] - https://docs.wso2.com/display/EMM110/Upgrading+from+a+Previous+Release

You need to configure WSO2EMM_DB, WSO2AM_DB and WSO2CARBON_DB and WSO2IDENTITY_DB if you are going ahead with a larger deployment. H2 is setup just for make the out of the box experience better. You can create those DBs, Configure master_datasources.xml properly for all above DBs. And then run the server with the flag -Dsetup. It will get the configurations done automatically.
If it fails, you can also go to SERVER_HOME/dbscripts folder and find all the scripts for all above databases. Run them separately and run the server in the usual way which mentioned in our documentation.

Related

connect oracle apex application to multiple databases

is there any simple way to connect an oracle apex application to another database other than apex admin database (like using WebLogic data source).
I read this but there are a lot of problem with that.
Run these commands
``
java -jar ords.war setup --database AML2
Enter number for [1] Basic [2] TNS [3] Custom URL [1]:3
Enter the Custom JDBC URL:sys/Syspass//192.168.1.1:1521/AML2
java -jar ords.war map-url --type base-path --workspace-id NEW_DB /NEW_DB AML2
``
And get success message after executing each command but when create and execute new workspace and app in the specified path (NEW_DB) get this error
The connection pool named: aml2_pu does not exist
how to resolve this problem or is there any simple or clear way to define connection in a file or WebLogic data source.
thanks for your attention
An APEX installation is in the database, it doesn't "connect to the database", there also isn't something like an "admin database" - as such, it cannot connect to other databases. Your apex application and the data for that application live in the same database instance.
However, if you want to work with data from other databases in your application you can of course do so. The "old way" is using database links, however, nowadays connecting over rest is the way to go.
The documentation you are referencing is for having ORDS pointing to multiple databases. It is possible to have a single ORDS installation point to multiple APEX instances - in a previous job we used to have dev/uat/int instance on the same ORDS instance. Each of those databases have their own apex installation.

Sync postgres database via git

We are 3 students working on a django project with postgres database and we sync our project with eachother via a git repository like gitlab. we have different os (windows 10 and linux ubuntu 20). and we use vscode as IDE.
How can we sync our entire database (data entry) via git (like sqlite) ?
Is there any way to handle it via kind of converting our db to file ?
Its very complicated to sync your three local database. The best way is to host your database into a cloud platform and all 3 of you connect to that.
There are free cloud platform you can use for 1 year like amazon web service, google cloud platform. You just need an active debit/credit card, it won't charge you except for amazon, it will deducted 1 dollar for account verification.
I would definitely go with this answer.
If you do not want to do that, use pg_dump to export the data from the database as a text file and sync that one using git. But you might still get a lot of merge conflicts.
I use https://www.elephantsql.com/ for it and it works! thank you

What is the best WSO2 upgrade strategy?

What is the best / flexible WSO2 upgrade strategy?
Because now we are upgrading WSO2 DSS 3.0.1 to DSS 3.1.1, therefore there is some difficult changes in dbs file one by one
wso2dss-3.0.1
<data name="BASE_PERSON_DataService" serviceNamespace=
"http://company.mn/base/BASE_PERSON">
wso2dss-3.1.1
<data description="multiple services per each table" enableBatchRequests="false"
enableBoxcarring="false" name="BASE_PERSON_DataService"
serviceNamespace="http://company.mn/base/BASE_PERSON" serviceStatus="active">
What is the easy way, we have many data services (dbs files)?
Regards,
Eba
As far as I know, there is usually no standard migration tool or procedure available. Check that the newer version uses a compliant schema for the wso2 registry database and so on; maybe it's the same or you just need to create new additional tables. Sometimes you find things like migration scripts in the dbscripts folder. You should also check for differences in newer xml configuration files, and adjust your older custom configuration to the new format (usually few or no changes could be required). As far as the artifacts are concerned, I never heard of any way to convert them. If there are many of them, I would probably try some script and regex to batch modify and adjust them to the new format.
These are the steps you should follow if you are upgrading
Step 1 - Deploy artifacts {dbs/datasource/drivers}
Cappy the deployed data services from current installation to new installation by copying repository/deployment/server folder.(all dbs files are backword compatible so what ever worked in WSO2 DSS 3.0.1, should work on DSS 3.1.1) Also note you need to copy data source configuration properties if you have created carbon data sources therefore copy master-datasources.xml from repository/conf/datasources to the new installation.
Also Copy all the content of repository/component/lib to the new installation to ensure the the jdbc drivers are properly installed.
Step 2- Change the configuration files
Apply the same changes you have done to configurations files inside OLD_DSS/repository/conf to NEW_DSS/repository/conf (if you have done any such to any configuration files)
Note - If you have done registry mounting make sure you apply to the new installation as done before by changing relevant configuration files such as
carbon.xml,axis2.xml,user-mgt.xml,mgt-transports.xml

Copying Embedded H2 database data to another registry instance

I have a local Gov. registry 4.6.0 setup with standard out of box H2 embedded database where I added lots of artifact types and data to each custom artifact type.
I want to copy all data from my local H2 database to another Gov. registry 4.6.0 instance which is running on a server.
I do not want to repeat this on the registry instance running on the server and have to recreate the custom artifact types and have to re add the data that I have locally.
I could not find any documentation that allows me to do that.
Is there any way to do this?
Also how can I connect to and browse the embedded H2 database? Is there some script to run?
Thanks
There are actually two options,
H2 database can be found at /repository/database directory. You can simply copy this directory in to other server and replace it. To do that, 1st stop both server, then copy the directory and replace it with other server's directory. Then restart both.
Registry check-in check-out client. More detail are in docs
You can connect to H2 database and browser it. In this blog, It has been explained. You can go through it.
One way is to use the Check-in client that is shipped with WSO2 GReg. You can use the the Check-in client to take a dump of the registry (with -f option), and then check-in that dump to the new registry db.

Options for maintaining MySQL databases for a django development team

What are some options to avoid the latency of pointing local django development servers to a remote MySQL database?
If developers use local MySQL databases to avoid the latency, what are some useful tools to sync schema updates of the remote db with the local db and avoid manually creating, downloading, and loading dumps?
Thanks!
One possibility is to configure the remote MySQL database to replicate to the developers local machine - assuming you have control of the remote database's configuration.
See the MySQL docs for replication notes. Using MySQL replication the remote node would be the Master and the developer machines would be Slaves. The main advantage of this approach is your developer machines would always remain synchronized to the Master database. One possible disadvantage (depending on the number of developer machines you are slaving) is a degradation in the remote database's performance due to extra load introduced by replication.
It sounds like you want to do schema migrations. Basically it's a way to log schema changes so that you can update and even roll back along with your source changes (if you change a model you also check in a new migration that has up and down commands). While this will likely become an official feature at some point, there are several third-party solutions to choose from. It's really a personal preference, here are some popular ones:
South
Django Evolution
dmigrations
I use a combination of South for schema migrations, and storing JSON fixtures (or SQL dumps) of useful test data in the VCS repo for the project. Works pretty seamlessly.