Mysql to postgres Migration pgloader not working - No data imported No Errors - data-migration

I tried the following command and it returns no errors but the data is not imported in my postgres database.
Database is already created in Postgres.
pgloader mysql://user:password#127.0.0.1/db_name postgresql://pgloader_pg:password#127.0.0.1/pg_db_name
This is the result:
LOG pgloader version "3.6.7~devel"
I am not sure what is the issue.

Related

Mysql to postgres Migration pgloader "ERROR mysql: 76 fell through ECASE expression"

While I try to migrate my MySQL Databse to postgres database.
I Face the Following Error.
How to Solve this ?

sequelize does not create database on local machine

I am running:
sequelize db:migrate
on my local machine and it outputs:
Sequelize CLI [Node: 15.10.0, CLI: 6.2.0, ORM: 5.8.6]
Loaded configuration file "src/db/db.config.js".
Using environment "development".
but no migration takes place on my local machine. The same code and command migrate the DB normally on a Google cloud instance. How do I debug this problem? My device is Macbook Pro running macOs High Sierra 10.13.6.
Note: the database is already created. Even when I try to delete the DB and run sequelize db:create, still nothing happens.

How to connect Guidewire to Oracle database?

I have installed Oracle in my system and wanted to change my local database to Oracle, but making changes in the database-config.xml I am unable to get my server started and getting the following error:
java.lang.RuntimeException : No Appropriate database found in
configuration: env = 'local'
Just add to your configuration file (database-config.xml) the parameter env="local".
Example:
<database
autoupgrade="full"
name="BillingCenterDatabase"
dbtype="oracle"
env="local">

Import and add index to mongodb on a Dokku install

I have a recently deployed app on an Ubuntu server using Dokku. This is a Node.js app with a Mongodb database.
For the site to work properly I need to to load geojson file in the database. On my development machine this was done from the ubuntu command line using the mongoimport command. I can't figure out how to do this in Dokku.
I also need to add a geospatial index. This was done from the mongo console on my development machine. I also cant figure out how to do that on the Dokku install.
Thanks a lot #Jonathan. You helped me solve this problem. Here is what I did.
I used mongodump on my local machine to create a backup file of the database. It defaulted to a .bson file.
I uploaded that file to my remote server. On the remote server I put the bson file inside a folder called "dump". Then tarred that folder. I initially used the -z flag out of habit but mongo/dokku didn't like the gzip. So I used tar with no compression like so:
tar -cvf dump.tar dump
next I ran the dokku mongo import command:
$dokku mongo:import mongo_claims < dump.tar
2016-03-05T18:04:17.255+0000 building a list of collections to restore from /tmp/tmp.6S378QKhJR/dump dir
2016-03-05T18:04:17.270+0000 restoring mongo_claims.docs4 from /tmp/tmp.6S378QKhJR/dump/docs4.bson
2016-03-05T18:04:20.729+0000 [############............] mongo_claims.docs4 22.3 MB/44.2 MB (50.3%)
2016-03-05T18:04:22.821+0000 [########################] mongo_claims.docs4 44.2 MB/44.2 MB (100.0%)
2016-03-05T18:04:22.822+0000 no indexes to restore
2016-03-05T18:04:22.897+0000 finished restoring mongo_claims.docs4 (41512 documents)
2016-03-05T18:04:22.897+0000 done
That did the trick. My site immediately had all the data.
mongodump will export all the data + indexes from an existing database.
https://docs.mongodb.org/manual/reference/program/mongodump/
Then mongorestore will restore a mongodump with indexes to an existing database.
https://docs.mongodb.org/manual/reference/program/mongorestore/
mongorestore recreates indexes recorded by mongodump.
You can do both commands from you dev machine to the Dokku database.
Importing works well, but since you mentionned mongo console, it's nice to know that you can also connect to your Mongo instance if you use https://github.com/dokku/dokku-mongo's mongo:list and mongo:connect...
E.g.:
root#somewhere:~# dokku mongo:list
NAME VERSION STATUS EXPOSED PORTS LINKS
mydb mongo:3.2.1 running 1->2->3->4->5 mydb
root#somewhere:~# dokku mongo:connect mydb
MongoDB shell version: 3.2.1
connecting to: mydb
> db
mydb
Mongo shell!
> exit
bye
For dokku v0.5.0+ and dokku-mongo v1.7.0+
Use mongodump to export your data into an archive:
mongodump --db mydb --gzip --archive=mydb.archive
Use dokku:import to import your data from an archive
dokku mongo:import mydb < mydb.archive

Unable to query mongolab mongodb

I'm using the Nodejitsu and their packaged Mongolab MongoDB database. I ran the command jitsu databases get myDB and I got instructions on how to connect via mongo CLI. The out put of that command has a line that says the following:
help: Connect with the `mongo` cli client:
help:
$ mongo ds039267.mongolab.com:39267/nodejitsu_xxxxxx_nodejitsudb8577296358 -u nodejitsu_xxxxxx -p mypassword
NOTE: This is the first time I am connecting to this instance via the CLI. I only created the database name through jitsu databases create…
I am using Mongo Shell version 1.8.3. I connected to my instance of MongoDB. I tried running the command: show dbs and I got:
uncaught exception: listDatabases failed:{ "ok" : 0, "errmsg" : "unauthorized" }
I am using Mongoose and I have a model called Post. I tried to run: db.post.find() in the CLI, I got:
error: { "$err" : "not authorized for query on hotel.post", "code" : 16550 }
What does this mean? Am I not authorized; I thought I connected successfully?
Updated
I upgraded my mongo shell to the latest, 2.4.x version and still I'm getting this problem. Anyone have any experience with nodejitsu & mongolab?
MongoLab creates databases that require an authenticated user to access. When you connect with the Shell, you will need to provide the UserName and Password to the shell command. Docs are here.
mongo --username Mark --password something
You will need that Username/Password combination to be configured within mongoose as well. The Mongoose docs have details on the possible ways to do this.
Note that you are using a very old shell. 1.8.3 is about 4 versions back from the current 2.4.* line. This is not directly related to your problem, but it's definitely something you should rectify going forward.
Inside the mongo shell try to authenticate once again:
db.auth('yourUsername','yourPassword');
One possible error could be like me : Using special chars in the password breaks the URI!
The generated password was
X/apm~nq5JaJ,5
So OBVIOUSLY, the / broke the request and I got :
MongoError: not authorized for query on apm~nq5JaJ.system.indexes
You can try to include at the end of your URI: ?authMode=scram-sha1

Resources