Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentapi ? #18

Open
pexpert9 opened this issue May 7, 2018 · 4 comments
Open

documentapi ? #18

pexpert9 opened this issue May 7, 2018 · 4 comments

Comments

@pexpert9
Copy link

pexpert9 commented May 7, 2018

v1-to-v2-migrator/src/dumpSourceData.js

module.exports = () => {
  logStep('Dumping source data', true);
  const timestampFilter = config.timestamp ? [`stored: {$gte: new Date("${config.timestamp}")}`] : [];
  const createdAtFilter = config.timestamp ? [`created_at: {$gte: new Date("${config.timestamp}")}`] : [];
  const lrsIDFilter = config.source.lrsId ? [`lrs_id: ObjectId("${config.source.lrsId}")`] : [];
  const lrsFilter = config.source.lrsId ? [`_id: ObjectId("${config.source.lrsId}")`] : [];

  const statementFilter = createQueryFilter(['active: true'].concat(lrsIDFilter, timestampFilter));
  const documentFilter = createQueryFilter(lrsIDFilter.concat(createdAtFilter)); // **** Question 1

  const clientFilter = createQueryFilter(lrsIDFilter);
  const storeFilter = createQueryFilter(lrsFilter);

  return Promise.all([
    dumpCollection('statements', statementFilter),
    dumpCollection('documentapi', documentFilter), // **** Question 2
    dumpCollection('client', clientFilter),
    dumpCollection('lrs', storeFilter),
  ]);
};

er

Question 1 :
documentapi table not available in LRS V1.
So, I want to know about that "documentapi" referese to which table in LRS V1.

Question 2 :
const timestampFilter = config.timestamp ? [stored: {$gte: new Date("${config.timestamp}")}] : [];
can we creates a any config JSON to take timestamp and so many fixed value which are used in source code.

@pexpert9
Copy link
Author

pexpert9 commented May 7, 2018

On Steps No. 5 of "Migrating local data" Through various Error Message during the migration .
# 1.) Socket Connection Error :
the options [socketOptions] is not supported

2.) Un handle promise rejection

(node:31048) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): MongoError: connection 4 to localhost:27017 timed out
(node:31048) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): MongoError: connection 5 to localhost:27017 timed out
(node:31048) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): MongoError: connection 9 to localhost:27017 timed out
(node:31048) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): MongoError: connection 7 to localhost:27017 timed out
(node:31048) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 5): MongoError: connection 11 to localhost:27017 timed out
{ MongoError: connection 4 to localhost:27017 timed out

Screen Shot :

err1
err11
err2

Please Provide any solution to perform above error.

Thanks

@ryasmi
Copy link
Member

ryasmi commented May 8, 2018

Re: Question 1
This has occurred because there weren't any documents stored in your V1 database. You should be able to go into your Mongo database and run db.createCollection('documentapi')

Re: Question 2
In your JSON config file you can add a timestamp property in the root config object to determine at what timestamp you'd like to migrate data from. This property is used to avoid unnecessarily re-migrating data that has already been migrated into the new V2 database.

Re: Question 3
I'm 90% certain that you can just ignore the socketOptions errors. More of a warning than an error in this case.

Re: Question 4
Since your connections appear to be timing out, I'd suggest lowering the migration batch size.

@pexpert9
Copy link
Author

pexpert9 commented May 8, 2018

Hi ryansmith94,
Thanks so much for your valuable suggestion.

@pexpert9
Copy link
Author

I have suggestion
Please Updated the LRS V2 script for installing mongodb. because script install mongodb 2.6 and it 2.6 is very basic for perform many task.

  1. It does not provide mongo shell.
    Most Important :
    When I used migration tool to update it then mongodump and mongorestore command causes problem and again we have to upgrade mongoDB again.
    So, at the time of LRS V2 installation higher mongo version will installed with installation script of LRS V2 then it reduced so many problem to us.
    Sorry for my request but it is helps to many users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants