Fixes #5745: Do the configid migration properly

Ticket: http://www.rudder-project.org/redmine/issues/5745

To be merged in 3.0
If you don't mind write "${RES}"