Skip to content

CourseSourceMigration

M. Drew LaMar edited this page Dec 18, 2021 · 4 revisions

Set up CourseSource on dev/prod

  • Pull in the following extensions (https://github.org/qubeshub/; ⭐ = new; ❌ no updates)
    • Components
      • com_collections
      • com_tags (Run two migration files)
      • ❌ com_fmns
      • com_groups
      • ❌ com_partners
      • com_publications (Run two migration files)
      • com_support
    • Modules
      • ❌ mod_mygroupsmini
      • ❌ mod_myprojectsmini
      • ❌ mod_partners
      • ❌ mod_showcase
      • ⭐ mod_collect
    • Plugins
      • ❌ plg_content_qubesmacros
      • ❌ plg_groups_projects
      • ❌ plg_groups_usage
      • ⭐ plg_groups_publications
      • plg_projects_files
      • plg_projects_publications
      • plg_publications_comments
      • plg_publications_forks
      • ⭐ plg_publications_watch
      • ⭐ plg_publications_versions
      • ⭐ plg_publications_usage
      • ⭐ plg_publications_supportingdocs
      • ⭐ plg_publications_share
      • ⭐ plg_publications_groups
      • ⭐ plg_publications_feed
      • ⭐ plg_publications_collections
      • ⭐ plg_publications_citations
      • ❌ plg_system_menurouter
      • plg_system_subnav
    • Templates
      • tpl_bmc
        • Alias: bmc
    • Libraries
      • ⭐ lib_hubzero
        • Alias: Qubeshub
        • Git API Key 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
  • Create a group with cn equal to coursesource - note the group id (dev: 2385)
  • Switch the group to a supergroup in the administrator interface
    • While you are in the admin interface, go to Users -> Groups, click on Options, choose the Super Groups tab, and make sure Super Group Components is set to Yes
    • Turn off the group courses plugin by going to Extensions -> Plug-in Manager, for - Select Type - choose groups, and disable Groups - Courses
  • Create the supergroup database sg_coursesource and Electric Citizen coursesource database via the following steps:
    • Go to the directory where the Vagrantfile is located and type vagrant up (if machine is down or not created) and then vagrant ssh.
    • Run the command mysql
    • At the mysql prompt, run GRANT CREATE, DROP ON `sg\_%`.* TO root@localhost;
    • At the mysql prompt, run CREATE DATABASE IF NOT EXISTS `sg_coursesource`;
    • At the mysql prompt, run CREATE DATABASE IF NOT EXISTS `coursesource`;
    • Type exit to leave mysql
    • Put the file coursesource_live_2021-01-20T05-00-00_UTC_database.sql into the public directory
    • At the ssh prompt, run mysql -u root -p coursesource < coursesource_live_2021-01-20T05-00-00_UTC_database.sql. It will ask you for a password - enter root.
    • Type exit to leave ssh
  • Manually clean 5 articles (coursesource.field_data_body WHERE bundle = "article" AND entity_id = ###)
    • Resource 1708 (. at end of JSON)
    • Resource 1778 (  at end of JSON)
    • Resource 1797 (JSON embedded in existing paragraph text)
    • Resource 1971 (Two JSON in one node)
  • Create a project in the CourseSource group entitled coursesourceresources
    • Make the file and publication quota for the project 10GB each
  • Upload resources to coursesourceresources project
    • First make sure upload limit is changed in plg_projects_files plugin
    • 1500
    • 1600
    • 1700
    • 1800
    • 1900
    • 2000
    • 2100
  • Import and publish resources
    • 1500
    • 1600
    • 1700+
      • 10
      • 20
      • 30
      • 40
      • 50
      • 60
      • 70
      • 80
      • 90
      • 100
      • 110
      • 120
      • 130
      • 140
      • 150
      • 160
      • 170
      • 180
      • 190
  • Pull in supergroup GitLab code
    • Change directory to public/app/site/groups
    • Run the command git clone https://gitlab.hubzero.org/<user>/coursesource.git <group id>, where <user> is the gitlab user you are using, and <group id> is the coursesource group id
  • Run migration files for coursesource supergroup
    • Go to the directory where the Vagrantfile is located and type vagrant up (if machine is down or not created) and then vagrant ssh.
    • Type cd /var/www/public
    • For updated master branch: Type php muse migration -d=up -f
    • For coursesource supergroup: Type php muse migration -r=app/site/groups/1003 -d=up -f

Set up CourseSource on vagrant box

  • Create a group with cn equal to coursesource - note the group id
  • Switch the group to a supergroup in the administrator interface
    • While you are in the admin interface, go to Users -> Groups, click on Options, choose the Super Groups tab, and make sure Super Group Components is set to Yes
    • Turn off the group courses plugin by going to Extensions -> Plug-in Manager, for - Select Type - choose groups, and disable Groups - Courses
  • Create the supergroup database sg_coursesource and Electric Citizen coursesource database via the following steps:
    • Go to the directory where the Vagrantfile is located and type vagrant up (if machine is down or not created) and then vagrant ssh.
    • Run the command mysql
    • At the mysql prompt, run GRANT CREATE, DROP ON `sg\_%`.* TO root@localhost;
    • At the mysql prompt, run CREATE DATABASE IF NOT EXISTS `sg_coursesource`;
    • At the mysql prompt, run CREATE DATABASE IF NOT EXISTS `coursesource`;
    • Type exit to leave mysql
    • Put the file coursesource_live_2021-01-20T05-00-00_UTC_database.sql into the public directory
    • At the ssh prompt, run mysql -u root -p coursesource < coursesource_live_2021-01-20T05-00-00_UTC_database.sql. It will ask you for a password - enter root.
    • Type exit to leave ssh
  • Create the config/db.php file with the following:
<?php
return array(
    'driver' => 'pdo',
    'host' => 'localhost',
    'user' => 'root',
    'password' => 'root',
    'database' => 'sg_coursesource',
    'prefix'   => ''
);
  • Create a project in the CourseSource group entitled coursesourceresources
    • Make the file and publication quota for the project 10GB each
  • Make sure Learning Materials is available as a category
  • Make sure DOI Namespace Start is set (bug - fix this!)
  • Pull in supergroup GitLab code
    • Change directory to public/app/site/groups
    • Run the command git clone https://gitlab.hubzero.org/<user>/coursesource.git <group id>, where <user> is the gitlab user you are using, and <group id> is the coursesource group id
  • Run migration files for coursesource supergroup
    • Go to the directory where the Vagrantfile is located and type vagrant up (if machine is down or not created) and then vagrant ssh.
    • Type cd /var/www/public
    • For updated master branch: Type php muse migration -d=up -f
    • For coursesource supergroup: Type php muse migration -r=app/site/groups/1003 -d=up -f

Clone this wiki locally