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

Document Central v2023.2 upgrade to Postgres 14 #1577

Merged
merged 33 commits into from
Mar 10, 2023

Conversation

lognaturel
Copy link
Member

@lognaturel lognaturel commented Feb 21, 2023

Alternative to #1573

TODO:

  • Have folks touch ./files/allow-postgres14-upgrade even if they use a custom db
  • Warning that there is a lot to download and this will take a long time on slow connections

I rebased the commits from #1573 on master to get sidebar updates (clean rebase). Then I separated out default and custom db instructions into tabs and added instructions on how to determine which one is being used.

I tried to identify points at which something could go wrong and provide some guidance.

The part I'm least happy with is the part about dealing with the docker-compose.yml conflicts in the custom db case. Unfortunately I don't think we can assume that everyone following these instructions would know how to resolve merge conflicts. We've seen organizations have high turnover and folks with very little IT experience suddenly becoming admins. I want to make sure folks like that have the best shot possible at getting this right.

Screen Shot 2023-02-20 at 5 16 14 PM

Archive.zip

@alxndrsn feel free to push to this branch and/or cherry pick my commits onto yours.

@alxndrsn
Copy link
Contributor

For some reason I don't get a finger mouse-pointer 👆 when mouse is hovering over these tabs. Tested in both Firefox & Chrome. Works fine on the example at https://sphinx-tabs.readthedocs.io/en/latest/.

@matthew-white matthew-white linked an issue Feb 21, 2023 that may be closed by this pull request
@lognaturel lognaturel changed the title Pg upgrade Document Central v2023.2 upgrade to Postgres 14 Feb 22, 2023
@ktuite ktuite self-requested a review February 28, 2023 17:28
Copy link
Member

@ktuite ktuite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've successfully gone through the basic upgrade steps! 🎉🎉🎉 I kind of want to try again and see what happens if I don't follow the rules, don't touch the right file, etc.

Left some comments about how the docs could give a little bit more context.

I went ahead and made these changes in a branch somewhere. I could do a PR on the PR, or just add them to this branch, but I wanted someone to see them first. They're here in this commit: 66a5a47

docs/central-upgrade.rst Show resolved Hide resolved
docs/central-upgrade.rst Outdated Show resolved Hide resolved
docs/central-upgrade.rst Outdated Show resolved Hide resolved
docs/central-upgrade.rst Outdated Show resolved Hide resolved
@lognaturel
Copy link
Member Author

Thanks, @ktuite, I have incorporated your commit!

@yanokwa

This comment was marked as resolved.

@yanokwa

This comment was marked as outdated.


touch ./files/allow-postgres14-upgrade

#. **Stop Central.** Central needs to be stopped in order to make a clean copy of the database.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to build, then stop. That will minimize your downtime. That's what we've done historically, but this should be tested.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm now wondering whether this is a good idea. That means things can happen between backup and stop. Maybe our standard recommendation should be to stop everything, back up, then do what needs to be done. Folks who are more advanced can do whatever they want.

Copy link
Member

@ktuite ktuite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was skimming the install on digital ocean section and the other files with minor changes. Looking again at the 2023.2 upgrade instructions next.

docs/central-install-digital-ocean.rst Outdated Show resolved Hide resolved
docs/central-install-digital-ocean.rst Outdated Show resolved Hide resolved
Copy link
Member

@ktuite ktuite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some thoughts from reading the docs w/o trying things yet!

docs/central-upgrade.rst Outdated Show resolved Hide resolved
docs/central-upgrade.rst Show resolved Hide resolved

.. tab:: Custom database

#. **Find instructions for upgrading your database server to PostgreSQL 14**. Here are instructions for some popular fully-managed options:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing has to change in the instructions, I was just thinking about folks that have a newer than 9.6 Postgres. How badly do they need to upgrade? Or what if they're on v15?

docs/central-upgrade.rst Show resolved Hide resolved

.. code-block:: console

$ git status
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was just wondering what some of these instructions would look like if they did the git pull step first. How different would cleaning up the config files be? In other words, how important is it that you migrate the custom config options before pulling the new code changes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a hard time making sense of how to fix the merge conflicts myself, even after doing it a few times. I was not able to come up with a good way to explain it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear, the process I've documented is what I ended up finding the easiest for myself.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They way I finally wrapped my head around this section:

  1. Make backups for files/service/config.json.template and docker-compose.yml
  2. Reset the git contents of those files
  3. Things from those two files specifically are moving to .env (i'd prefer if i could put them back into .env after i git pull)
  4. git stash any other changes you have so you can apply those changes after the upgrade

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! That looks about like what we have now but we've broken it down a bit more? Most folks will only have changes to either files/service/config.json.template or docker-compose.yml, hence the separation. I think copying to the local machine is much easier because of having multiple windows at once.

i'd prefer if i could put them back into .env after i git pull

Why?

docs/central-upgrade.rst Outdated Show resolved Hide resolved
docs/central-upgrade.rst Outdated Show resolved Hide resolved
Copy link
Member

@ktuite ktuite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More comments!

docs/central-install-digital-ocean.rst Outdated Show resolved Hide resolved
docs/central-troubleshooting.rst Show resolved Hide resolved
docs/central-troubleshooting.rst Show resolved Hide resolved

.. code-block:: console

$ git diff files/service/config.json.template
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I'm going through the steps, I feel very nervous about this step of copying values into another file and deleting my changes to this file long before I know if it will actually work. I think there should be a recommendation to make a copy/backup of this file to refer to just in case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is also awkward to check my diff and then enter new values into .env. I also wish I had the .env.template already.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a backup step.

awkward to check my diff and then enter new values into .env

Can you say more about that? Did you use the recommended process of copying the diff lines with + to a file on your computer?

wish I had the .env.template already.

Did you copy the blocks from the docs and paste them in?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did copy from the blocks, I just felt like I was doing this kind of blindly, not knowing where I'd end up.

I did go seek out the template, and seeing it made me think, "Oh, that's what i'm aiming for, that's not scary". I also used it to copy over the sentry values.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe this is because Cloud customizes everything? For most people only one or maybe two of these blocks will be relevant. Most common will be just email, I think.

docs/central-upgrade.rst Show resolved Hide resolved

.. code-block:: console

$ git status
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They way I finally wrapped my head around this section:

  1. Make backups for files/service/config.json.template and docker-compose.yml
  2. Reset the git contents of those files
  3. Things from those two files specifically are moving to .env (i'd prefer if i could put them back into .env after i git pull)
  4. git stash any other changes you have so you can apply those changes after the upgrade

docs/central-troubleshooting.rst Show resolved Hide resolved
@lognaturel lognaturel marked this pull request as ready for review March 9, 2023 23:54
Copy link
Member

@ktuite ktuite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay!

@lognaturel lognaturel merged commit ba6ab59 into getodk:master Mar 10, 2023
@lognaturel lognaturel deleted the pg-upgrade branch March 10, 2023 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update docs related to Postgres migration
5 participants