Migration of wallet accounts to labels

I have multiple accounts on older bitcoin core version (0.16.3) but in order to move to newer releases I must migrate accounts to new label format with additional database which hold each account balance. Since I have many accounts what is best (and easier) way to move all accounts to label format and to keep addresses that each account has.

Best regards