Finding a matrix $X$ that changes the basis(?) If I have some two dimensional vector space $V$ and a linear operator $\phi:V\to V$ and a matrix $A$ of $\phi$ with respect to some basis $\{a,a'\}$ and let $B$ its matrix with respect to another basis $\{b,b'\}$ and I want to find $X$ such that $XAX^{-1}=B$

I have a few thoughts:
I think I am looking at 
$$X\,\begin{bmatrix}a_1 & a_2 \\ a_1' & a_2 '\end{bmatrix}\,X^{-1} = \begin{bmatrix}b_1 & b_2 \\ b_1'& b_2'\end{bmatrix}$$
And I am also not sure, but it would seem to be the same form as diagonalisation(possibly coincidence). Is there any reason to believe this would imply $B_2=0=B_1'$?
Also: Since $X$ seems to be invertible, it must be square, so I guess I can look at how that treats $A$ after computing $XAX^{-1}$. I will have a look at this and edit.
 A: $\newcommand{\R}[0]{\mathbb{R}}$The columns of $X$ will be the coordinates of $b, b'$ with respect to the basis $a, a'$.

For example, suppose you have the linear operator on $\R^{2}$ that does
$$
\begin{bmatrix}1\\0\end{bmatrix}
\mapsto
\begin{bmatrix}1\\0\end{bmatrix},
\qquad
\begin{bmatrix}0\\1\end{bmatrix}
\mapsto
\begin{bmatrix}0\\-1\end{bmatrix}.
$$
With respect to the basis 
$$
a = \begin{bmatrix}1\\0\end{bmatrix},
\qquad
a'= \begin{bmatrix}0\\1\end{bmatrix},
$$
the matrix will be
$$
A =
\begin{bmatrix}1&0\\0&-1\end{bmatrix}.
$$
With respect to the basis
$$
b = \begin{bmatrix}1\\1\end{bmatrix},
\qquad
b'= \begin{bmatrix}1\\-1\end{bmatrix},
$$
the matrix will be
$$
B =
\begin{bmatrix}0&1\\1&0\end{bmatrix}.
$$
Now take
$$
X = 
\begin{bmatrix}1&1\\1&-1\end{bmatrix},
$$
and check that 
$$
B = X A X^{-1}.
$$
A: What does it mean for $A$ to be the matrix of $\phi$ with respect to the basis $\{a,a'\}$?
$$
\begin{bmatrix}
a\\
a'
\end{bmatrix}
M
=
\begin{bmatrix}
\phi(a)\\
\phi(a')
\end{bmatrix}
=
A
\begin{bmatrix}
a\\
a'
\end{bmatrix}
$$
Similarly,
$$
\begin{bmatrix}
b\\
b'
\end{bmatrix}
M
=
\begin{bmatrix}
\phi(b)\\
\phi(b')
\end{bmatrix}
=
B
\begin{bmatrix}
b\\
b'
\end{bmatrix}
$$
Therefore,
$$
\begin{bmatrix}
a\\
a'
\end{bmatrix}^{-1}
A
\begin{bmatrix}
a\\
a'
\end{bmatrix}
=
\begin{bmatrix}
b\\
b'
\end{bmatrix}^{-1}
B
\begin{bmatrix}
b\\
b'
\end{bmatrix}
$$
and
$$
\begin{bmatrix}
b\\
b'
\end{bmatrix}
\begin{bmatrix}
a\\
a'
\end{bmatrix}^{-1}
A
\begin{bmatrix}
a\\
a'
\end{bmatrix}
\begin{bmatrix}
b\\
b'
\end{bmatrix}^{-1}
=
B
$$
Therefore,
$$
X=
\begin{bmatrix}
b\\
b'
\end{bmatrix}
\begin{bmatrix}
a\\
a'
\end{bmatrix}^{-1}
$$
A: I hope that a graphical representation can help. In this representation one of the two basis is the canonical one (to simplify the figures) but the use of two generic non orthonormal basis does not substantially change the meaning.

The key fact is that vectors and transformations are geometric entities that do not change changing the basis in which they are represented. In other world: The components of a given vector and the entries of the matrix that represent a given transformation are different in different basis, but in such a way that the vector (or the transformation) remain the same.
The figures illustrate such situation for a linear transformation in $\mathbb{R}^2$.  Here the transformation has matrix:
$$
T_{i,j}=
\left[
\begin{array}{cccc}
1&2\\
1&-1
\end {array}
\right]
$$
where the subscript refers to the canonical basis $\{\mathbf{i},\mathbf{j}\}$. Acting on a vector $\mathbf{v}$ ( in the first figure $\mathbf{v}=[1,2]^T$), this transformation gives the vector $\mathbf{v'}$, that, in  the canonical basis, is (second figure):
$$ \mathbf{v'_{i,j}}=
T_{ij}\mathbf{v_{ij}}=
\left[
\begin{array}{cccc}
1&2\\
1&-1
\end {array}
\right]
\left[
\begin{array}{cccc}
1\\
2
\end {array}
\right]
=
\left[
\begin{array}{cccc}
5\\
-1
\end {array}
\right]
$$
Now we want to represent this same vectors and transformation in a new basis, e.g. $\{\mathbf{e_1},\mathbf{e_2}\}$ in the figure. This new basis is obtained transforming the canonical basis with the matrix
$$
P=
\left[
\begin{array}{cccc}
1&3\\
-1&1
\end {array}
\right]
$$
and his inverse
$$
P^{-1}=\dfrac{1}{4}
\left[
\begin{array}{cccc}
1&-3\\
1&1
\end {array}
\right]
$$
represents the transformation that returns from the new basis to the canonical one.
In this new basis the vectors $\mathbf{v}$ and $\mathbf{v'}$ have components:
$$
\mathbf{v_{1,2}}= P^{-1}\mathbf{v_{i,j}}=
\dfrac{1}{4}\left[
\begin{array}{cccc}
-5\\
3
\end {array}
\right]
$$
$$ \mathbf{v'_{1,2}}=
P^{-1}\mathbf{v'_{ij}}=
\left[
\begin{array}{cccc}
2\\
1
\end {array}
\right]=
P^{-1}T_{i,j}\mathbf{v_{i,j}}=P^{-1}T_{i,j}P\mathbf{v_{1,2}}=T_{1,2}\mathbf{v_{1,2}}
$$
where $T_{1,2}$ is the matrix that represents the transformation in the new basis.
So we have:
$$
T_{1,2}=P^{-1}T_{i,j}P=
\dfrac{1}{4}
\left[
\begin{array}{cccc}
-7&-1\\
1&7
\end {array}
\right]
$$
A: Since $X$ must be invertible, you can solve the set of equations given by 
$$XA = BX.$$ This gives $4$ linear equations for the $4$ unknown entries of $X$ in terms of the coefficients of $A$ and $B$. Solving this system then results in your matrix $X$.
More generally, if you want to find $X$ from the given basis vectors, this can also be done: simply solve the system $$Xa=b$$ $$Xa' = b'$$. 
A: To understand linear algebra well and get elegant notation, it is useful to write scalars on the right (when they multiply vectors), at least when writing functions and transformations to the left of their arguments (and composing in standard way from right to left). Doing so, it is useful to think of $n$-tuples of vectors (such as bases in an $n$-dimensional space) as row matrices with $n$-columns, and to allow these $n$-tuples of vectors to be multiplied on right by matrices of scalars having $n$ rows. 
For any $m$-tuple $U = (u_1, \dots, u_m)$ of vectors (a row matrix of $m$ vectors) and basis $W$ on an $n$-dimensional space, define $U_W$ to be the $n \times m$ (scalar) matrix such that $U = W U_W$ (it actually would be somewhat more logically coherent to write ${}_WU$ rather than $U_W$, but left subscripts are problematic typographically). Identifying $1$-tuples of vectors with vectors, if $u$ is a vector we also write $u = W u_W$, where $u_W$ is a column matrix. As one would expect since the $j$-th column of $U=WU_W$ depends on the $j$-th column of $U_W$, the $j$-th column of $U_W$ is ${u_j}_W$. Also notice that if $V$ and $W$ are bases, $V = W V_W = (V W_V)V_W = V (W_V V_W)$; this forces $W_V$ to be the inverse of $V_W$.
For any $m$-tuple $U = (u_1, \dots, u_m)$ of $u_i$ in the domain of a linear transformation $T$, let $T(U) = (T(u_1), \dots, T(u_m))$.  If $T$ is a linear transformation from a space with basis $V$ to a space with basis $W$, then $T(x) = T(Vx_V) = \text{(by linearity) } T(V)x_V = W T(V)_W x_V$. So $T(V)_W$ is the matrix ${}_WT^V$ of $T$ with respect to the bases $V$ and $W$. Notice ${}_WI^V = I(V)_W = V_W$.
Suppose $V$ and $W$ are bases of the same $n$-space, and $\phi$ a linear operator on that space. We have $\phi(V) = V\phi(V)_V$ (because $\phi(V)$ is an $n$-tuple). Plugging therein $WV_W$ for a couple instances of $V$, we get $\phi(WV_W) = WV_W\phi(V)_V$. But by linearity $\phi(WV_W) = \phi(W)V_W$. Thus, $\phi(W)V_W = WV_W\phi(V)_V$. Multiplying on the right on both sides by $(V_W)^{-1}$ gives $\phi(W) = W V_W\phi(V)_V {V_W}^{-1}$. But we know that $\phi(W)$ also equals $W \phi(W)_W$. Since $\phi(W)_W$ is uniquely determined by this equation, $\phi(W)_W = V_W\phi(V)_V {V_W}^{-1}$. Recall that the matrix $V_W$ is the matrix whose $j$-th column is ${v_j}_W$, where $v_j$ is the $j$-th element of the basis $V$. One may calculate its inverse directly or use that ${V_W}^{-1} = W_V$. Using your notation, we have $V=(a, a'), W=(b, b'), A = {}_V\phi^V=\phi(V)_V, B = {}_W\phi^W=\phi(W)_W, X = V_W$. 
Notice that given a standard (or otherwise) basis $E$, one has $V = E V_E = W E_W V_E$. So $E_W V_E = V_W$. (Notice that if we had used left subscripts, on the left side of this equation we would have ${}_WE {}_EV$, and canceling the $E$'s suggestively would yield ${}_WV$, as desired, but one can't do that with right subscripts or the matrices get multiplied in wrong order---a price to pay for writing linear transformations on left.)  Thus $V_W = {W_E}^{-1} V_E$, and so one may readily calculate $X = V_W$ if one knows $W_E$ and $V_E$. Suppose in your case that $E = (e_1, e_2)$. If $a = e_1 a_1 + e_2 a_2$ and $a' = e_1 a'_2 + e_2 a'_2$, then ${(V_E)}_{i1} = a_i$ and ${(V_E)}_{i2} = a'_i$. Similarly with $W_E$ and $b, b'$.
