mongify icon indicating copy to clipboard operation
mongify copied to clipboard

Pls help me abt Mongify sync Command

Open kshitijpal opened this issue 9 years ago • 9 comments

Pls give some tutorial abt mongify sync.

Iam getting this error.

Iam Added update_at datetime field in mysql.

/usr/local/share/gems/gems/mongify-1.2.4/lib/mongify/translation/sync.rb:74:in block in sync_data': undefined methodname' for nil:NilClass (NoMethodError) from /usr/local/share/gems/gems/mongify-1.2.4/lib/mongify/translation/sync.rb:58:in each' from /usr/local/share/gems/gems/mongify-1.2.4/lib/mongify/translation/sync.rb:58:insync_data' from /usr/local/share/gems/gems/mongify-1.2.4/lib/mongify/translation/sync.rb:29:in sync' from /usr/local/share/gems/gems/mongify-1.2.4/lib/mongify/cli/command/worker.rb:71:inexecute' from /usr/local/share/gems/gems/mongify-1.2.4/lib/mongify/cli/application.rb:28:in execute!' from /usr/local/share/gems/gems/mongify-1.2.4/bin/mongify:15:in<top (required)>' from /usr/local/bin/mongify:23:in load' from /usr/local/bin/mongify:23:in

'

kshitijpal avatar Dec 15 '15 11:12 kshitijpal

Hey @kshitijpal, Sorry to hear you're having troubles, the sync feature was added by @hammady, I'm hoping he will be able to help you.

anlek avatar Dec 15 '15 22:12 anlek

@kshitijpal it seems you don't have a column of type :key in your translations file. You must denote your primary key as such or else sync won't work.

hammady avatar Dec 16 '15 05:12 hammady

hi kshitijpal, did you managed to connect mongify with your mongodb database above version 3.0? I currently have some issue with connect the database with username and password, if you managed to do that, it will be great you can share how you did that, cheers

xudongli113 avatar Dec 16 '15 15:12 xudongli113

@hammady

This is my campaign Table which i want to sync in Mongodb

##This sis my Transaltion File ## table "campaign" do column "campaignid",:key, :as => :integer column "campaign_name_short", :string column "updated_at", :timestamps end

##This is my Database.config## sql_connection do adapter "mysql" host "localhost" username "root" password "admin" database "mongo_sync" encoding "utf8" end

mongodb_connection do host "localhost" database "mongo_sync" end

Case 1: First Command i run For Db Migration :

mongify process database.config translation-differentsync.rb

Then i run run Sync Command For Sync:

mongify sync database.config translation-differentsync.rb

After This in mongodb there is one old record and one updated record with different id but sync means mongify has to update the record in mongdb not to create duplicate entry

kshitijpal avatar Dec 18 '15 06:12 kshitijpal

@kshitijpal as stated in the README you must run sync from the start.

hammady avatar Dec 19 '15 07:12 hammady

@hammady ,

I run sync command first not process but it will not sync the data. Pls help its urgent. or if possible can u please create a tutorial video like this(http://mongify.com/ home page ) for sync .

Regards Kshitij

kshitijpal avatar Jan 05 '16 09:01 kshitijpal

hammady,

in my mysql table that is created by mongify sync (mongify_sync_helper) column last_updated_at is not updated pls help. Regards Kshitij

kshitijpal avatar Jan 06 '16 14:01 kshitijpal

I will have a look.

On Wed, Jan 6, 2016 at 5:45 PM Kshitij Pal [email protected] wrote:

hammady,

in my mysql table that is created by mongify sync (mongify_sync_helper) column last_updated_at is not updated pls help. Regards

Kshitij

— Reply to this email directly or view it on GitHub https://github.com/anlek/mongify/issues/79#issuecomment-169341785.

hammady avatar Jan 19 '16 04:01 hammady

Thank you for your help @hammady!

anlek avatar Jan 25 '16 20:01 anlek