Let $E/ \mathbb{Q}_p$ be a finite extension, let $\mathcal{O}$ be the ring of integers of $E$. Let $A$ be a reduced noetherian local complete $\mathcal{O}$-algebra with the maximal ideal $\mathfrak{m}$. (I guess this particular setting does not really matter and the statement should be true for more general $A$'s)

Let $M \in GL_n(A)$ be a $n \times n$-matrix. Suppose that for every height $1$ prime ideal $\mathfrak{p}$ of $A$, the reduced mod $\mathfrak{p}$ matrix $M / \mathfrak{p}$ is conjugate to an upper triangular matrix with coefficients in $A / \mathfrak{p}$. Under what conditions (on $M$ or even better: just on $M / \mathfrak{m}$) the matrix $M$ is conjugate to an upper triangular matrix with coefficients in $A$?

I'll be grateful for your help.