Identity Server chpasswd.sh script not working with PostgreSQL database - wso2

I'm receiving the following response while running the below command in my Identity Server /bin folder:
./chpasswd.sh --db-url "jdbc:postgresql://localhost:5432/wso2registry_db" --db-driver "org.postgresql.Driver"
Database driver [org.postgresql.Driver] not found in classpath.
Can someone point me in the right direction?
References:
WSO2 API Manager: chpasswd.sh does not work when using external database

Copy the database driver jar to the [CARBON_HOME]/lib directory and try your command.

Related

MongoDB migration from local host to a Linux server

So, I have a Django app, that is connected to a MongoDB database on my local machine.
I brought my Django app on a Redhat Linux server. So, now I need MongoDB to be installed on the server:
1- Do I need to have access to the root on Linux server to install MongoDB?
2- I could not find any straight forward instruction to what to do for migration of MongoDB. Do know any references?
I appreciate if you could help me with this.
Thanks
First, you should capture the database file:
Find this directory on windows cmd:
C:\Program Files\MongoDB\Tools\100\bin
write the following in the cmd:
“mongoexport --db --collection --out
output.json”
find the database JSON file in that directory
Now you should export you database to the server directory:
scp -r /mnt/d/database.json
#:/home/...
Now you should import the mongodb database:
mongoimport --db --collection --file

Error occured during project deployement in pythonanywhere

I have done it many times in windows operating system but now i am using Ubantu as my primery system. So when i tried makemigrations command inside my project directory(server) pythonanywhere bash throw below error.
(myproject) 07:29 ~/Product-Management-System (master)$ python manage.py makemigrations
django.db.utils.OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)")
Please someone help me!!
It sounds like you haven't configured your database correctly in your settings.py. It's trying to connect to a MySQL database running on the computer where the Django code is running, and there is no database server there.
On PythonAnywhere, you should go to the "Databases" page and set up a MySQL server for your project there. Then, in your settings.py, set up the connection settings -- HOST should be the one that is displayed on the "Database" page when the MySQL server has been created, as should USER, and the PASSWORD should be the one you specified when you created the server. PORT should just be an empty string.

Error in ballerina Sql connector configurations

I have an issue with the mysql connector when i'm trying to make a connection with a staging database. There is no issue with the connection when I try locally. The error is attached below
The staging Db configs are as follows.
[mysqld] max_allowed_packet=1G
Thanks!

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

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

Django manage.py commands with Google App Engine and Vagrant

I have a Google App Engine app and I'm running Windows with Vagrant. I have an Ubuntu installation which I access via vagrant ssh. On that machine I installed the Google App Engine SDK for Python and I can successfully deploy my app with:
appcfg.py update myapp --oauth2 --noauth_local_webserver
The --noauth_local_parameter allows me to copy the oauth URL and paste in the browser on my Windows machine, because on the Linux machine I have no GUI. Everything is working fine.
But now I want to use the Django manage.py syncdb command, to create the tables in Google Cloud SQL. The problem is, when I execute that command, the text-based w3n browser starts for the authorization, and then I get the error message that the browser does not support javascript.
I'd like to run the manage.py commands with the --noauth_local_webserver flag, but that is not supported by the manage.py commands. How can I solve this? I have already installed an Ubuntu virtual machine with GUI and given the app the permission and manage.py works fine on that machine, but when I try to execute the command on the Vagrant (non GUI) machine, it stills want to open the browser for permission.
Hm, I manually copied the oauth .dat file to the vagrant server, and manage.py syncdb is now working, but the website still can't connect in the browser; it says:
No valid OAuth 2.0 credentials. Before using the Google SQL Service backend on dev_appserver, you must first run "manage.py syncdb" and proceed through the given instructions to fetch an OAuth 2.0 token.
It seems to be the same errors as here. In my case it seemed that the necessary GOOGLE_SQL_OAUTH2_REFRESH_TOKEN environment variable was not set. I copied this refresh token from the .dat file and set it in the app.yaml:
env_variables:
GOOGLE_SQL_OAUTH2_REFRESH_TOKEN: "..."
Now everything is working fine.