Skip to content
This repository has been archived by the owner on Dec 4, 2021. It is now read-only.

rake task to recreate capped collection when size is changed #49

Closed
smostovoy opened this issue Feb 3, 2013 · 7 comments
Closed

rake task to recreate capped collection when size is changed #49

smostovoy opened this issue Feb 3, 2013 · 7 comments

Comments

@smostovoy
Copy link
Contributor

If collection size is changed in config the only way to apply it now is manual. I see tests already recreate it so just create a rake task and maybe capistrano task would be helpful.

@le0pard
Copy link
Owner

le0pard commented Feb 3, 2013

Good idea. Does this rake task should migrate data from old collection?

@smostovoy
Copy link
Contributor Author

for me it's not important but generally I think - yes, it should

@le0pard
Copy link
Owner

le0pard commented Feb 4, 2013

Ok, I will add this task soon.

@le0pard
Copy link
Owner

le0pard commented Mar 15, 2013

Done. You can try it.

rake mongodb_logger:copy_data["test_logs", 1024000]

where "test_logs" - name of collection, in which we want copy data, 1024000 - size of "test_logs" collection in bytes (this value need, if such collection not exist). If you already created new collection and just need copy data, you can use the same command, but without last argument:

rake mongodb_logger:copy_data["test_logs"]

@smostovoy
Copy link
Contributor Author

Sorry, I see only copy_data task, but don't see 'recreate_collection' which is primary need

le0pard added a commit that referenced this issue Mar 15, 2013
@le0pard
Copy link
Owner

le0pard commented Mar 15, 2013

@smostovoy, sorry, now I understand my mistake. New task called:

rake mongodb_logger:migrate

Just change in mongodb_logger config size of capper collection and run this rake task :)

@smostovoy
Copy link
Contributor Author

Thanks, it works nice. Added cap task - #52

le0pard added a commit that referenced this issue Mar 15, 2013
@le0pard le0pard closed this as completed Mar 15, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants