Test Mode or Limit on Number of Records?
mikebronner opened this issue · 3 comments
Hi, we have a fairly large database to convert from MySQL to MongoDB. This looks like the best tool I've come across so far for performing the conversion process.
Is there a way to limit the number of records to convert, so that we can test the conversion results before running all our 3+ million records?
Thanks!
There is no real way to limit the number of records. In the next week I will allow you to do a before_save
and set row
to nil
to prevent it from being writing into MongoDB, so you might be able to do something like this:
table "users" do
before_save do |row|
row = nil if row["id"] >= 30 #assuming your ids start from 1
end
end
I would need a way to limit the query on the mysql side of things, as we can't be pulling down 3GB of data each time we run a conversion test. I guess I would have to set up a test database with a subset of records to work off of. Thanks for the pointer, though. :)
Yes, a test database (with limited data) would be much smarter! ;)
Let me know if you have any other issues.