Were is the subjunctive form of be ( if I were / you were / he were / we were / they were ) used for hypothetical statements. Be to is an idiomatic verb expressing planned future. Together ( were to have/go/be/ etc) they express a hypothetical planned future.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.