Overhang.io

Upgrade from makefile version to tutor

#1

I’m working on upgrading from makefile to tutor. Here is a summary of where I am on this:

Here are notes that might help Regis improve the instructions:

  • I suspect it might be best to make stop before backing up, but that wasn’t mentioned.

  • I noticed I had to sudo to do the cp -r to backup.

  • It wasn’t totally clear if it mattered where I was when I did tutor local quickstart. It seemed to work from my original openedx directory. I like all those green OK’s going by. :wink:

  • Unfortunately I had a problem with the certificates. See below:

Databases ready.

HTTPS certificates generation

docker run --rm -it --volume /home/frohro/.local/share/tutor/data/letsencrypt:/etc/letsencrypt/ -p 80:80 --entrypoint=sh certbot/certbot:latest -c certbot certonly --standalone -n --agree-tos -m admin@edx.fweb.wallawalla.edu -d edx.fweb.wallawalla.edu -d studio.edx.fweb.wallawalla.edu -d preview.edx.fweb.wallawalla.edu

certbot certonly --standalone -n --agree-tos -m admin@edx.fweb.wallawalla.edu -d notes.edx.fweb.wallawalla.edu

docker: Error response from daemon: driver failed programming external connectivity on endpoint gallant_brattain (69fbf58008ed2b6d421af3a2207a24e31b82053bc1ecb201f5e53fd558f2af37): Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use.
Error: Command failed with status 125: docker run --rm -it --volume /home/frohro/.local/share/tutor/data/letsencrypt:/etc/letsencrypt/ -p 80:80 --entrypoint=sh certbot/certbot:latest -c certbot certonly --standalone -n --agree-tos -m admin@edx.fweb.wallawalla.edu -d edx.fweb.wallawalla.edu -d studio.edx.fweb.wallawalla.edu -d preview.edx.fweb.wallawalla.edu

certbot certonly --standalone -n --agree-tos -m admin@edx.fweb.wallawalla.edu -d notes.edx.fweb.wallawalla.edu

frohro@fweb:~/openedx-docker$

So I stopped apache2, which was a tip from tony-h when I needed to renew certificates, and ran tutor local quickstart again.

Now I think it is up!

However, I can’t sign in yet. I’ll go read the docs.

I did tutor local createuser --staff --superuser yourusername user@email.com with my credentials, but all my classes are gone, and I suspect all my students are lost too.

I tried reindexing the courses, with no effect.

Then I decided this was not likely something I’ll fix in a minute or two so I went to restart my old makefile setup. It reminded me I had not restarted apache2, so I did that and it is back up and running at the moment, so all is well.

It would be nice to finish the upgrade though.

I’m tempted to make stop the old one, and do ttutor local start --detach, again now that apache2 is up, but I really don’t know what I’m doing, and don’t want to mess things up.

Any ideas?

Thanks,

Rob

#2

Hi @frohro!
Sorry for not replying earlier, as you may have noticed my email server had an issue that prevented it from sending notifications about new posts…

  • I suspect it might be best to make stop before backing up, but that wasn’t mentioned.

Absolutely.

  • I noticed I had to sudo to do the cp -r to backup.

Yes, you’re right about that.

  • It wasn’t totally clear if it mattered where I was when I did tutor local quickstart.

It does not matter, because tutor now stores all data in ~/.local/share/tutor.

Unfortunately I had a problem with the certificates. See below:

Let’s try not to bother about certificates for now.

  1. For a starter, please locate the old data folder that contains all the databases, including courses and students. This is the folder that you don’t want to lose. You need to sudo cp -r this folder somewhere, just in case something goes wrong. Indeed, your old platform should be stopped before doing anything else.
  2. Make sure you have tutor v3.2.1 installed: you can check the version with tutor --version.
  3. Copy your config.json file to ~/.local/share/tutor. If this folder does not exist, create it.
  4. Run tutor config save --silent. Make sure that config.json was converted to config.yml. Also, make sure that this file contains the right NGINX_HTTP_PORT and NGINX_HTTPS_PORT values.
  5. Copy your data to ~/.local/share/tutor/data.
  6. Run tutor local start. Do you see any error in the logs?
#3

Hi Regis,
The config.yml had no entries for the nginx port numbers so I added them, but I get the following error.

frohro@fweb:~/.local/share/tutor$ tutor local start
docker-compose -f /home/frohro/.local/share/tutor/env/local/docker-compose.yml --project-name tutor_local up --remove-orphans
Creating tutor_local_mysql_1 … done
Creating tutor_local_memcached_1 … done
Creating tutor_local_rabbitmq_1 … done
Creating tutor_local_elasticsearch_1 … done
Creating tutor_local_openedx-assets_1 … done
Creating tutor_local_mongodb_1 … done
Creating tutor_local_smtp_1 … done
Creating tutor_local_notes_1 … done
Creating tutor_local_xqueue_consumer_1 … done
Creating tutor_local_xqueue_1 … done
Creating tutor_local_forum_1 … done
Creating tutor_local_cms_1 … done
Creating tutor_local_lms_1 … done
Creating tutor_local_cms_worker_1 … done
Creating tutor_local_nginx_1 … error
Creating tutor_local_lms_worker_1 … done

ERROR: for tutor_local_nginx_1 Cannot start service nginx: driver failed programming external connectivity on endpoint tutor_local_nginx_1 (471687e715432b1f9b3801fffbf48957f4c8cea3962acd4563dca83a1a417546): Error starting userland proxy: listen tcp 0.0.0.0:443: bind: address already in use

ERROR: for nginx Cannot start service nginx: driver failed programming external connectivity on endpoint tutor_local_nginx_1 (471687e715432b1f9b3801fffbf48957f4c8cea3962acd4563dca83a1a417546): Error starting userland proxy: listen tcp 0.0.0.0:443: bind: address already in use
ERROR: Encountered errors while bringing up the project.
Error: Command failed with status 1: docker-compose -f /home/frohro/.local/share/tutor/env/local/docker-compose.yml --project-name tutor_local up --remove-orphans

You still have login rights if you wish to muck about. :wink:

Rob

#4

An interesting thing is that the config.yml seems to get modified by trying to start tutor. it is missing a number of items if I look at it now, including the port numbers.
Rob

#5

Yes, you need to re-configure the nginx port numbers with:

tutor config save --silent --set NGINX_HTTP_PORT=81 --set NGINX_HTTPS_PORT=444

(replace 81 and 444 with the port numbers you selected previously)

#6

Hi Regis,
I got around to working on this again this morning, and was able to upgrade it to version 3.2.1. Thanks so much for all the help!
Rob

#7

Hi Regis, et. al.,
It is close to time for me to renew my ssl certificate. I try and I get this:
:~$ tutor local https renew
HTTPS is not activated: certificate renewal skipped
Any advice?
Thanks,
Rob

#8

Unless I’m mistaken, in your case the certificate was generated on the host because you are running apache in front of tutor. So, I think you should simply run “sudo certbot renew”? Maybe set up a monthly cron job so that you don’t have to think about it anymore?