Migrating WSO2 api manager databases - wso2

I'm trying to migarte my API from one environment to another environment by copying H2 databases from wso2am-2.1.0/repository/database.
I know there is an utility for import/export but I have a lot of API and this utility is only processing by one API.
After copying databases , my APIs and tags are not shown in the store/publisher dashboard.
But if I check applications-->subscriptions, I can see theses API.
Any explication about this behaviour please?

Basically, WSO2 does not recommend to run production in H2 database. I hope this is a testing/ try out scenario. When you are running in production please use a production-ready databases such as oracle, mysql, mssql, etc.
The issue here is things you have listed as missing comes from the indexing. In your case, if there are lots of APIs, it would take time to index. WSO2 uses solr to index resources. If you copy the solr directory which resides in the WSO2 server folder to the new environment would work. Before replacing the folder please delete the complete folder in the new environment.
If this is not working you can re-index resources by following - https://stackoverflow.com/a/42646742/3176125.
When you are moving from one environment to another you need to copy the content which resides in the /repository/deployment/server/ folder. It contains synapse configs of the APIs, custom sequences, etc.

Related

Terraform UI for non technical CLI users?

I currently have a server build process that uses Terraform and deploys a server all from code.
I'm looking for a web UI with forms that I could either populate specific fields and or do API get commands against a VCenter or wherever the server is being built to populate the specific fields. The fields that get populated would be stored as the variables.tf file and when someone hits submit, it would run the actual Terraform command terraform apply to build the server based on the variables. My guess is the terraform binaries would have to live on there so it could run in the background.
It doesn't have to be some super fancy web page, just something that I could potentially make look cool for Director level folks.
Also, I don't want to use TF enterprise, yet. I've looked into a couple of open source projects (atlantis and terrahub) but none seem to be what I'm looking for.
I'm far from a web developer so any help would be awesome.
You can try with SLD
Stack-Lifecycle-Deployment
I think it has everything that you need
It is very intuitive, it has a web interface and a rest api to easily integrate it with the rest of the applications.

Error Configuring WSO2 data analytics server

I'm currently experimenting/working on WSO2. What i'm trying to do is to have Data Analytics server configured. I started by following the below specified URL
https://docs.wso2.com/display/AM210/Configuring+APIM+Analytics#9d6747f5c0074928b18599abe472987d (Quick Steps)
After performing all the steps, i get the following issue on APIM cmd prompt
YES Its pretty evident from the error that no such table exists BUT that is exactly the issue i'm facing. What could really be the cause here?
Consider the following points:
I've not followed ALL the steps mentioned on
https://docs.wso2.com/display/DAS310/Getting+Started (BUT are they
required?)
In the installation prerequisites for DAS, JDBC-compliant Connector for Java is required which I've not yet installed (BUT its not mandatory at the same time)
Most of the QUICK STEPS for the configuration of DAS in the specified URL i.e. https://docs.wso2.com/display/AM210/Configuring+APIM+Analytics#9d6747f5c0074928b18599abe472987d where already in place and i only had to
Set Up JDK, ANT, Maven
enable the analytics section in the API-M_HOME/repository/conf/api-manager.xml
add log4j.rootLogger=, DAS_AGENT to API-M_HOME/repository/conf/log4j.properties
add snappy-java_1.1.1.7.jar to DAS_HOME\repository\components\lib
Yet the issue persists, Do let me know of what you think. Thank you
Since you are following quick start guide please extract the WSO2 API Manager and the WSO2 API-M Analytics distributions (zip files), to the same directory (preferably an empty directory).
Also, you need to generate some traffic to the published APIs in order to analytics server to create this table for the first time.

Redmine project data for all projects

I am working on creating a dashboard which would access Redmine project data. This dashboard will be a consolidation of project data (delivery date, manager, start date, total issues, open issues, closed issues, bug count etc.) for all projects in the Redmine database.
Any ideas on how to do this? An SQL query to achieve this would be a good start. I have Redmine setup on my local system and can access the Redmine database.
I plan on creating an HTML5 .Net based web application. Once I figure out the queries to be used, I would write an IIS (or REST) service to fetch the desired data from the Redmine production database.
Any help/pointers would be deeply appreciated.
Regards,
Pranjal
You have basically three options:
use the REST API
develop a redmine plug-in
do some custom SQL stuff
REST API
The best you could do is to use the redmine REST API. Using it, you can fetch the data directly from redmine without any SQL queries or manipulating the server. It should even work when the redmine server is updated.
Redmine Plug-in
The next best thing is probably to develop a redmine plug-in. Your plug-in can access redmine classes (Project, User, etc.). For example, you could do something like Projects.all.map {|p| [p.id, p.identifier]} to get the id and identifier of all projects in an array. This approach is way more powerful than using the REST API, but you have to modify the redmine server (install and maintain your plug-in). A plug-in is probably more fragile when redmine changes internal structures, than the REST API.
Custom SQL stuff
I do not recommend developing custom SQL solutions, but it is an option. Such a solution is harder to develop, more fragile, harder to set up, but might offer better performance.
You can see the the redmine database structure listed in db/schema.rb. Having the right schema, you could develop your custom SQL queries and return them to your dashboard.
Think about security
Apart from the usual security stuff (which you should consider too :)), remember that redmine has a rich permission system. Consider which object you make (publicly) available. This is most important for the last two options. When using the plug-in approach, you should have a look at the User#allowed_to method.
With the little information I have about your requirements, I have the feeling that you should go for the REST API.

Migrate files from one esb to other

I have created few proxies, sequences and endpoints in wso2 esb in my system. I want to transfer these proxies, sequences and endpoints to another esb hosted at server. How to do this successfully?
Looking forward to your answers. Thanks in advance.
Lets say you have your first ESB located at ESB01_HOME directory and it contains all your defined proxy services, endpoints and other configurations. Now you took another fresh copy of the WSO2 ESB and extract that to a folder called ESB02_HOME.
You can copy the configuration files which were stored in ESB01_HOME/repository/deployment/server/synapse-configs/default (entire folder) in to the same directory in the ESB02 (ESB02_HOME/repository/deployment/server/synapse-configs/default). Now you can start the ESB02 and you can observe that all the configurations are installed in the ESB02.
If you are starting both the servers (ESB01 and ESB02), then you need to change the Offset parameter of the ESB02 carbon.xml configuration file which is located in the (ESB02_HOME/repository/conf/carbon.xml)
If you are copying the configurations from an older version of WSO2 ESB (3.x.x) then these configurations are located at ESB01_HOME/repository/conf/synapse-configs folder.
If both are in a clustered setup you can use deployment synchronizer/registry based synchronizer..If both are separate instances, copy the synapse-config folder(inside that, you can find proxy/seq/endpoint folders) to another home directpry
you can use the checkin-client tool inside the GREG.
With this tool you can move information from registry in ESB1 to registry in ESB2. information like dynamic sequences and endpoints for example.

WSO2 ESB - Data Services Server Feature - How to use Data Sources to swap data source on fly

I am using WSO2 ESB 4.0.3. I have installed WSO2 Data Services Feature on it and I have created DS.
There is feature in the ESB under "Configure" tab under admin UI where you can define the "Data Source".
My question is while creating new Data Service I am not able to use this "Data Source" which I have configured in ESB. We have different environments DEV / TEST / UAT / PROD. Each environment has different data base for same data service.
Currently I have manually change the DS XML file to point to new DB and then deploy.
Is there a way to point to the DB configured in ESB and change the DB for DS on the fly?
thanks
ABhijit
07/01/2012 -
Any update on this please ? This is Apple POC in their big group. If suceedded WSO2 will have Apple implementation?
If you've installed the dataservices features in to the same ESB instance that you've already been using, then it should be possible for you to use the datasources created via "Configure > Data Sources" menu. Because, when you create a particular datasource via the aforesaid option, it is visible to all the other installed features (that use datasources). But if you're having ESB and DSS in two boxes, the datasources defined in let's say ESB are not visible the DSS node unless you're having those nodes mounted to the same registry. However, this functionality too will be there in the next immediate upcoming release.
However, I'd suggest you the following pattern to get your requirement done. I;m assuming you're having DataServices features installed into ESBs in all your environments DEV / TEST / UAT / PROD. If so, you can create datasources using the "same name" (for eg: assume you have a datasource named "ds1" created in all 4 environments) via the "Configure > DataSources" menu pointing to different database configurations that you'll be using in each of those environments. Then you can point to the created datasource inside the DBS (dataservice discripters) as shown below.
<data name="TestDataService">
<config id="default">
<property name="carbon_datasource_name">ds1</property>
</config>
.....
</data>
Once you're done with those steps, whenever you deploy your dataservice in any of your environments, it will point to the relevant datasource without requiring you to reconfigure the database configurations manually and the relevant database configurations specific to each environment will be loaded dynamically at the runtime.
Hope the above explanation helps!
Regards,
Prabath
#----- Start of the configuration -----
synapse.datasources=TestDS,TestDS1
synapse.datasources.icFactory=com.sun.jndi.rmi.registry.RegistryContextFactory
synapse.datasources.providerPort=2199
#TestDS Configuration
synapse.datasources.TestDS.registry=JNDI
synapse.datasources.TestDS.type=BasicDataSource
synapse.datasources.TestDS.driverClassName=com.mysql.jdbc.Driver
synapse.datasources.TestDS.url=jdbc:mysql://localhost:3306/testDB
synapse.datasources.TestDS.username=dummy_username
synapse.datasources.TestDS.password=dummy_password
synapse.datasources.TestDS.dsName=TestDS
synapse.datasources.TestDS.maxActive=100
synapse.datasources.TestDS.maxIdle=20
synapse.datasources.TestDS.maxWait=10000
#TestDS1 configuration
synapse.datasources.TestDS1.registry=JNDI
synapse.datasources.TestDS1.type=BasicDataSource
synapse.datasources.TestDS1.driverClassName=com.mysql.jdbc.Driver
synapse.datasources.TestDS1.url=jdbc:mysql://localhost:3306/testDB1
synapse.datasources.TestDS1.username=dummy_username
synapse.datasources.TestDS1.password=dummy_password
synapse.datasources.TestDS1.dsName=TestDS1
synapse.datasources.TestDS1.maxActive=100
synapse.datasources.TestDS1.maxIdle=20
synapse.datasources.TestDS1.maxWait=10000
#----- End of the configuration -----