It was purely investor pressure to make the company worth more for an eventual sale.
I found out I was the only one kept to keep the lights on a particular system. The system still generates lots of money, but C-level wants to invest in other options. It was made very clear that there's no opportunity for me to improve on it or work on my domain area.
Now Im stuck in a thankless maintenance role and doing duties outside of my job description. Worst yet, now I have to be always on-call so nothing fails.
Im trying to look for a new job, but between raising two small kids and the stress of on-call duty, I dont feel like I have energy or time to interview around.
I also found out that I was kept on the payroll just because of my knowledge of this system. Never mind everything else that I created and that other teams now own and get to improve on.
How can I get over this feeling of being worthless?
> I have to be always on-call so nothing fails.
You have agency in where you set your boundaries with your employer, perhaps quite a lot more than you feel or have been exercising historically. Decide how much you on-call you are willing to do and don't do any more for free. E.g. if you're paid to work 40 hours per week, don't volunteer to donate another 20 hours of work to the investors for free. Do your 40 and turn work comms off.
Management has decided to under-resource your team, for management to understand this has caused a problem, they need to experience the consequences of the decision, and feel that it is causing a problem for them personally. You can help them understand the situation by limiting your on-call participation to a level that is sustainable and makes sense for you and your family (and leaves you with enough energy outside of work). Then if the system goes down when you are not scheduled on-call, you need to leave your managers to deal with the fallout until you are back at work in your scheduled business hours.
If you don't respond to an on call alert until the next day.. what are they going to do, fire you?
The maintenance work overloading you. Push back.. a week becomes two. Drag things on.. then push to upgrade to speed things up (and get you back in your domain). They will refuse but ignore your longer schedule.
Now you can take on that second job or prepare for interviews
Now, I totally get that isn't the job you want, and they aren't treating you well. But it isn't a sign of being worthless. Find something better, but do it with confidence that you are seen as being quite capable in your work.
Once they get an alternative system they are going to do away with you.
The "what should you do" part--people here can help with that.