Issue with API Manager migration from 1.8.0 to 2.1.0: IS migration client 5.1.0 does nothing - wso2

I am doing a migration from APIM 1.8.0 to APIM 2.1.0 and facing an issue with one of migration tools.
Naturally, I am following the steps described in migration guide: https://docs.wso2.com/display/AM210/Upgrading+from+the+Previous+Release
My OS is Windows 7 Enterprise x64, Java - Oracle JDK 7u67, DB - MySQL 5.7, user store - LDAP.
I downloaded WSO2 Identity Server 5.1.0 Migration Client (org.wso2.carbon.is.migrate.client-5.1.0-migration.zip SHA1: ece8ff9a33167751268d205293cc1404fbe4c567) from docs.wso2.com/download/attachments/50518205/org.wso2.carbon.is.migrate.client-5.1.0-migration.zip?version=2&modificationDate=1470811755000&api=v2 as described in guide metioned above (step 7).
Then I unzipped it and put necessary DB scripts into directory APIM_2.1.0_HOME/dbscripts/ (steps 7-a, 7-b) and JAR file into directory APIM_2.1.0_HOME/repository/components/dropins/ (step 7-c).
After that when I try to migrate Identity and User Store DBs (step 9) using IS migration client starting APIM instance with command
wso2server.bat -Dmigrate -DmigrateIdentityDB -Dcomponent=identity
it looks like nothing happens.
I've even configured a logger for this client in APIM_2.1.0_HOME/repository/conf/log4j.properties as
log4j.logger.org.wso2.carbon.is.migration=DEBUG
but only two DEBUG rows appear in logs telling me that migration component activated successfully:
INFO {org.wso2.carbon.databridge.core.internal.DataBridgeDS} - Successfully deployed Agent Server {org.wso2.carbon.databridge.core.internal.DataBridgeDS}
DEBUG {org.wso2.carbon.is.migration.client.internal.ISMigrationServiceComponent} - Setting RealmService to WSO2 IS Migration component {org.wso2.carbon.is.migration.client.internal.ISMigrationServiceComponent}
DEBUG {org.wso2.carbon.is.migration.client.internal.ISMigrationServiceComponent} - WSO2 IS migration bundle is activated {org.wso2.carbon.is.migration.client.internal.ISMigrationServiceComponent}
INFO {org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService} - Configured Registry in 63ms {org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService}
Moreover, I looked at the source code of the client at github.com/wso2/product-is/tree/v5.1.0/modules/migration/migration-5.0.0_to_5.1.0/wso2-is-migration-client, especially at class org.wso2.carbon.is.migration.client.internal.ISMigrationServiceComponent and its method activate(ComponentContext context), which in fact does nothing in contrast to similar class github.com/wso2/product-apim/blob/v2.1.0/modules/distribution/resources/migration/wso2-api-migration-client/src/main/java/org/wso2/carbon/apimgt/migration/client/internal/APIMMigrationServiceComponent.java from another migration client, also provided in migration guide mentioned above (step 4).
And finally, I noticed that relevant code was removed in one of the commits: "removing the migration from pack and adding script changes" https://github.com/wso2/product-is/pull/362/files#diff-789b1c66c0ca3e073080a2b8e6c27834L49
So, my questions are:
Why were those lines of code removed?
And the main question is how to trigger migration client properly? What did I do wrong?
I would appreciate any kind of help.

It was an issue with the migration document. Documentation is now changed. you will have to do a migration to 2.0.0 from 1.8.0 and then to 2.1.0.
https://docs.wso2.com/display/AM210/Upgrading+from+the+Previous+Release#8910

Related

Problem in configuring the APIM cluster with WSO2 APIM 3.2

Description:
I build the APIM from this commit and deploy the product on the VMs.
I configured APIM using Documents 1 and 2
Then start the traffic-manager, key-manager, and publisher without any error.
But when I tried to log in to example.com/publisher, I experienced some errors.
Like below:
logs.txt
After getting these errors, I checked the service providers section and saw that the apim_publisher application was created but OAuth keys didn't exist.
Then I checked the consumer_key and consumer_secret's value on the AM_SYSTEM_APPS table in apim_db database, and both of them was undefined
Steps to reproduce:
Build product-apim from this commit
Move wso2am-3.2.0-SNAPSHOT to 5 VMs.
Run the below command for profile optimization for each node.
sh bin/profileSetup.sh -Dprofile=$PROFILE_NAME
Run components in the following order:
sh wso2am-3.2.0-tm/bin/wso2server.sh -Dprofile=traffic-manager
sh wso2am-3.2.0-km/bin/wso2server.sh -Dprofile=api-key-manager
sh wso2am-3.2.0-pub/bin/wso2server.sh -Dprofile=api-publisher
Open the publisher page
Affected Product Version:
APIM 3.2.0 (MariaDB)
Environment details (with versions):
OS: Ubuntu 18.04
Client: Ubuntu 20.04

Can we install a FAB(Fuse Application Bundle) on the WSO2 application server

As the title says, I would like to know if I can deploy fab bundles on the WSO2 application server. One way I guess this is possible is to install the fab-bundle feature and then deploy the fab jar but would like a confirmation of the same.
No this is not possible. FAB requires Karaf/Fuse as the OSGi application server.
Notice that FAB is deprecated and to be removed in the next Fuse 6.2 release.

can wso2 carbon 4.1 run as a web app (war)?

I'm limited to what applications I can deploy in my environment, however, standard WAR files are usually not a problem.
Can carbon 4.1.0 run as a web app?
This link describes how it can be done for carbon 3.2.2. Are these steps still valid for 4.1.0?
According to the answer in this link some functionality is limited in webapp mode for 3.2.2. What functionality is limited if 4.1.0 is deployed in webapp mode?
EDIT:
A webapp-mode folder is available in $CARBON_HOME
C:\Users\snowc\Desktop\wso2carbon-4.1.0>type webapp-mode\README.txt
Running WSO2 Carbon in Webapp mode
-------------------------------------
Standalone mode is the recommended way of running All WSO2 Carbon products. However you have the
option of running WSO2 Carbon products in Webapp mode (hosted as a web-app in an application
server).
1. The 'WEB-INF' directory contains the webapp archive
2. The 'bundles' directory contains the additional jars that needs, during the web-app mode
deployment.
Please refer the WSO2 Carbon documentation for step-by-step guide on web-app mode deployment of the
product.
"Can carbon 4.1.0 run as a web app?"
No, we stopped supporting webapp deployment in later 4.x.x carbon versions

Cannot export Web Application to WSO2 Application Server with Developer Studio 2.1.0

I downloaded the latest version of WSO2 Developer Studio:
developer-studio-eclipse-jee-helios-linux-gtk-x86_64-2.1.0.zip
and the WSO2 Carbon 4 based Application Server version:
wso2as-5.0.1.zip
unzipped both and started Developer Studio. As I want to deploy a Maven
webapp project, I installed m2e on top of WSO2 Developer Studio.
Then I followed this article:
http://wso2.org/library/articles/2012/09/develop-deploy-web-applications-using-wso2-developer-studio#section3
apart from the fact that the WSO2 Carbon and WSO2 AS versions are different and that I already
have a maven war project which is imported into my workspace.
After creating a distribution project for my web app project, I add the webapp project
to it. Afterwards I add that distribution project to the Carbon Server (wit 'Add/Remove').
The WSO2 Carbon server is started, but then a message is shown 'Can't find export handler for war'.
We repeated the steps several times, sometimes this stack trace appears on the console:
java.lang.Exception: Can't find export handler for war
at org.wso2.developerstudio.eclipse.platform.core.project.export.util.ExportUtil.buildProject(ExportUtil.java:84)
at org.wso2.developerstudio.eclipse.distribution.project.export.CarExportHandler.exportArtifact(CarExportHandler.java:184)
at org.wso2.developerstudio.eclipse.platform.core.project.export.util.ExportUtil.buildProject(ExportUtil.java:81)
at org.wso2.developerstudio.eclipse.platform.core.project.export.util.ExportUtil.BuildCAppProject(ExportUtil.java:105)
at org.wso2.developerstudio.eclipse.distribution.project.ui.wizard.DistributionProjectExportWizard.performFinish(DistributionProjectExportWizard.java:181)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:811)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:430)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.wso2.developerstudio.eclipse.distribution.project.ui.action.ExportDistributionAction.run(ExportDistributionAction.java:36)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
What is the correct way of deploying a mavenized web app to the WSO2 Carbon Application Server from WSO2 Developer Studio?
Thanks
Can you paste the content of the Eclipse error log here for more inspection? Though it says it cannot find the Handler for WebApp, i suspect the real error is something else.
You can find the Eclipse Error log at /.metadata/.log file.
Regarding the correct way to deploy a Web-App to WSO2AS from WSO2 Developer Stidio, this article you referred explains the correct approach.
/Harshana
Maybe m2e on top of WSO2 Developer Studio is the problem. As I can deploy WARs into WSO2AS without running into any exception, but I don't have installed m2e in my WSO2 Developer Studio.
Have you compared your existing POM with the POM generated for a webproject by the WSO2 Developer Studio?

Not able to start WSO2 ESB 4.0.3 in linux box

I have started wso2 4.0.3 in my local and tested It is working fine.
But same version I have installed in linux box,server not started it is showing below error. I used this command to start: nohup sh wso2server.sh
ERROR - DatabaseUtil Database Error - Table "UM_DIALECT" not found;
SQL statement:
SELECT COUNT(UM_ID) FROM UM_DIALECT WHERE UM_TENANT_ID=? [42102-140]
org.h2.jdbc.JdbcSQLException: Table "UM_DIALECT" not found; SQL statement:
SELECT COUNT(UM_ID) FROM UM_DIALECT WHERE UM_TENANT_ID=? [42102-140]
It should be working fine if you are using fresh binary pack (zip). Are you using different type of database other than H2? (H2 is the default database shipped with the binary pack)
if you are getting this error again, please start sever with -Dsetup option.
Ex : wso2server.sh -Dsetup
Thanks,
Chamara Silva
It happen because your WSO2 ESB is missing previous data from the previous database.
You can find your carbon database in
$wso2dir\repository\database\WSO2CARBON_DB.h2.db
Maybe there are files that missing or can't be copied to your linux environment (not only your carbon database but also other configuration files). Based on #ChamaraS's answer, i also suggest you to using fresh binary pack or create a backup pack with your custom configuration.
ps: i am just curious if you used Filezilla to transfer those files (face same problem here)