Energy landscapes of perfect and defective solids: from structure prediction to ion conduction