Hi mihaic,
just copy all classes (section from previous /config/bigip.conf) into a single file on your /shared directory and name it i.e. ./classes, please:
cat ./classes | tr -d "\r\n" | sed -r "s/(\})/\1\n/g" | \
sed -r -e 's/^[[:blank:]]+//g' -e 's/\}$/ }/g' | tr -s '[[:blank:]]' | \
sed -r 's/^profile httpclass ([^ ]+) \{ defaults from httpclass pool ([^ ]+) paths regex ([^ ]+) \}/ltm rule rule_\1 {\n if { [string tolower [HTTP::uri]] starts_with \3 } {\n pool \2\n }\n}\n/g'
The one-liner above should convert the existing classes into iRules.
Instead of putting the classes into file and to "cat" you can try as well a tmsh command to list all classes:
tmsh list ltm httpclass | tr -d "\r\n" | sed -r "s/(\})/\1\n/g" | \
sed -r -e 's/^[[:blank:]]+//g' -e 's/\}$/ }/g' | tr -s '[[:blank:]]' | \
sed -r 's/^profile httpclass ([^ ]+) \{ defaults from httpclass pool ([^ ]+) paths regex ([^ ]+) \}/ltm rule rule_\1 {\n if { [string tolower [HTTP::uri]] starts_with \3 } {\n pool \2\n }\n}\n/g'
Output can be merged into running configuration.
Thanks, Stephan