By far the best if not the only solution.
Looks like you have an adjoining cupboard to the one that came down. I'd recommend that you take that cupboard (and any others on that wall and use the rail to support all the cupboards.
If you have adjoining cupboards there should be fixings to hold...