0.2.2 • Published 2 years ago

@helfa/drupal-mongodb-migrate v0.2.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

drupal-mongodb-migrate

Migration script, querying Drupal JSON:API and storing responses in our own MongoDB schema.

Install

yarn add -g @helfa/drupal-mongodb-migrate

Run

WARNING: Most of the data handled by this script is sensitive. We are talking people's passwords, emails, names, even addresses at times. Do not ever check-in any files inside the ./out/ folder!

  1. Get the .env.example and set your values in it
curl -o .env.migrate https://gitlab.com/helfa-web/drupal-mongodb-migrate/-/raw/next/.env.example
  1. Source the values in .env.migrate into your current shell with
source .env.migrate
  1. Run the script
drupal-mongodb-migrate

Env

All variables except MONGO_HOST and MONGO_PORT (which default to the sample values) are required.

namedescriptionexample
DRUPAL_COOKIEThe entire Set-Cookie string from an authenticated request to your Drupal instance. Also, make sure that the user this session cookie belongs to has the necessary rights to read all fields (probably some admin account)SSESS99...=lakds22ih2%ashd...
DRUPAL_API_BASEURL to your Drupal isntance's JSON:APIhttps://mydrupal.com/en/api
MONGO_HOSTHost of your MongoDBlocalhost
MONGO_PORTPort of your MongoDB27017
MONGO_USERUser to authenticated with at your MongoDBmemyselfaneye
MONGO_PASSPassword to authenticated with at your MongoDBIhopeIwillRememberThis!
MONGO_DBName of your databasezappapp