From 4ccfe3822c7755fbdb5541dec251bd422462919b Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 29 May 2019 00:20:43 +0200 Subject: [PATCH] added existing data imports --- .../migration/neo4j/categories.cql | 2 +- .../maintenance-worker/migration/neo4j/comments.cql | 2 +- .../migration/neo4j/contributions.cql | 2 +- .../maintenance-worker/migration/neo4j/follows.cql | 2 +- .../maintenance-worker/migration/neo4j/import.sh | 12 ++++++------ .../maintenance-worker/migration/neo4j/shouts.cql | 2 +- .../maintenance-worker/migration/neo4j/users.cql | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/deployment/legacy-migration/maintenance-worker/migration/neo4j/categories.cql b/deployment/legacy-migration/maintenance-worker/migration/neo4j/categories.cql index 776811bec..81e73c1b9 100644 --- a/deployment/legacy-migration/maintenance-worker/migration/neo4j/categories.cql +++ b/deployment/legacy-migration/maintenance-worker/migration/neo4j/categories.cql @@ -1,4 +1,4 @@ -CALL apoc.load.json('file:/tmp/mongo-export/splits/current-chunk.json') YIELD value as category +CALL apoc.load.json("file:${IMPORT_CHUNK_PATH_CQL}") YIELD value as category MERGE(c:Category {id: category._id["$oid"]}) ON CREATE SET c.name = category.title, diff --git a/deployment/legacy-migration/maintenance-worker/migration/neo4j/comments.cql b/deployment/legacy-migration/maintenance-worker/migration/neo4j/comments.cql index 234d29d26..1c8eb9397 100644 --- a/deployment/legacy-migration/maintenance-worker/migration/neo4j/comments.cql +++ b/deployment/legacy-migration/maintenance-worker/migration/neo4j/comments.cql @@ -1,4 +1,4 @@ -CALL apoc.load.json('file:/tmp/mongo-export/splits/current-chunk.json') YIELD value as json +CALL apoc.load.json("file:${IMPORT_CHUNK_PATH_CQL}") YIELD value as json MERGE (comment:Comment {id: json._id["$oid"]}) ON CREATE SET diff --git a/deployment/legacy-migration/maintenance-worker/migration/neo4j/contributions.cql b/deployment/legacy-migration/maintenance-worker/migration/neo4j/contributions.cql index 01647f7fb..e60f053b8 100644 --- a/deployment/legacy-migration/maintenance-worker/migration/neo4j/contributions.cql +++ b/deployment/legacy-migration/maintenance-worker/migration/neo4j/contributions.cql @@ -1,4 +1,4 @@ -CALL apoc.load.json('file:/tmp/mongo-export/splits/current-chunk.json') YIELD value as post +CALL apoc.load.json("file:${IMPORT_CHUNK_PATH_CQL}") YIELD value as post MERGE (p:Post {id: post._id["$oid"]}) ON CREATE SET p.title = post.title, diff --git a/deployment/legacy-migration/maintenance-worker/migration/neo4j/follows.cql b/deployment/legacy-migration/maintenance-worker/migration/neo4j/follows.cql index 0cd6d9cfc..bf3837b04 100644 --- a/deployment/legacy-migration/maintenance-worker/migration/neo4j/follows.cql +++ b/deployment/legacy-migration/maintenance-worker/migration/neo4j/follows.cql @@ -1,4 +1,4 @@ -CALL apoc.load.json('file:/tmp/mongo-export/splits/current-chunk.json') YIELD value as follow +CALL apoc.load.json("file:${IMPORT_CHUNK_PATH_CQL}") YIELD value as follow MATCH (u1:User {id: follow.userId}), (u2:User {id: follow.foreignId}) MERGE (u1)-[:FOLLOWS]->(u2) ; diff --git a/deployment/legacy-migration/maintenance-worker/migration/neo4j/import.sh b/deployment/legacy-migration/maintenance-worker/migration/neo4j/import.sh index 9e0189166..12cc7ce67 100755 --- a/deployment/legacy-migration/maintenance-worker/migration/neo4j/import.sh +++ b/deployment/legacy-migration/maintenance-worker/migration/neo4j/import.sh @@ -27,21 +27,21 @@ echo "MATCH (n) DETACH DELETE n;" | "${IMPORT_CYPHERSHELL_BIN}" -u ${NEO4J_USERN # Import Data echo "Start Importing Data" import_collection "badges" -#import_collection "categories" -#import_collection "comments" -#import_collection "contributions" +import_collection "categories" +import_collection "users" +import_collection "follows" +import_collection "contributions" +import_collection "shouts" +import_collection "comments" #import_collection "emotions" -#import_collection "follows" #import_collection "invites" #import_collection "notifications" #import_collection "organizations" #import_collection "pages" #import_collection "projects" #import_collection "settings" -#import_collection "shouts" #import_collection "status" #import_collection "systemnotifications" -#import_collection "users" #import_collection "userscandos" #import_collection "usersettings" diff --git a/deployment/legacy-migration/maintenance-worker/migration/neo4j/shouts.cql b/deployment/legacy-migration/maintenance-worker/migration/neo4j/shouts.cql index 5019cdc32..a82a7a33d 100644 --- a/deployment/legacy-migration/maintenance-worker/migration/neo4j/shouts.cql +++ b/deployment/legacy-migration/maintenance-worker/migration/neo4j/shouts.cql @@ -1,4 +1,4 @@ -CALL apoc.load.json('file:/tmp/mongo-export/splits/current-chunk.json') YIELD value as shout +CALL apoc.load.json("file:${IMPORT_CHUNK_PATH_CQL}") YIELD value as shout MATCH (u:User {id: shout.userId}), (p:Post {id: shout.foreignId}) MERGE (u)-[:SHOUTED]->(p) ; diff --git a/deployment/legacy-migration/maintenance-worker/migration/neo4j/users.cql b/deployment/legacy-migration/maintenance-worker/migration/neo4j/users.cql index c877f8377..693fd75b6 100644 --- a/deployment/legacy-migration/maintenance-worker/migration/neo4j/users.cql +++ b/deployment/legacy-migration/maintenance-worker/migration/neo4j/users.cql @@ -1,4 +1,4 @@ -CALL apoc.load.json('file:/tmp/mongo-export/splits/current-chunk.json') YIELD value as user +CALL apoc.load.json("file:${IMPORT_CHUNK_PATH_CQL}") YIELD value as user MERGE(u:User {id: user._id["$oid"]}) ON CREATE SET u.name = user.name,