Depending on your situation this may be a matter of preference. That being said, we can attempt to break the problem down somewhat objectively.
First off, you mentioned a concern about mobile platforms not supporting legacy OpenGL. Objectively, you can re-frame that as:
- Will the existing game engine currently work on your target platforms?
If the answer is no, then either you need to rework / replace the engine OR adjust to target platform expectations.
If the answer is yes, then the next thing to consider is:
- Will the engine work on the target platforms for the duration that you expect to support the game?
Again, if the answer is no, then either you need to rework / replace the engine OR adjust to your expectations regarding how long the game will be viable.
There are some other factors you may wish to consider. If your personal goal is to learn modern OpenGL, then sinking time into a legacy development doesn't make sense. And as pointed out in the comments, transitioning the engine to use modern OpenGL might be easier than rewriting it from scratch.
Finally, while modern OpenGL is likely to be more performant for modern games and the demands they place on GPUs, modern video cards are typically fast enough to handle the legacy OpengGL from older games, in part due to the fact that the graphics expectations were lower. If those expectations aren't good enough for you (i.e. you want to render the game in 4k, use high resolution textures, support VR, etc) then you'll need to weigh the expense of finding ways to execute those objective in legacy OpenGL against the expense of porting or rewriting to support the modern APIs.