The only sure way I know is to restore your device as new with iTunes. Do not use a back up. A back up will contain the old passcode. You will lose your data, including photos. So put your photos somewhere safe. Upload them to your computer or to Box or Dropbox.
There are other solutions offered online on the Apple discussions forums.
NOTE: I have not chosen to restore device yet to see my if I am prompted for to set up a password or if I am asked for the previous password. I will chose to restore after backing up all of my devices. Will be sometime later tonight or tomorrow.
Here is what I did. Deleted iTunes completely. Then manually deleted my backups. Not from within iTunes. Searched for this %appdata%. Then from there go to folder Apple Computer > MobileSync > Backups to find the backups. You need to use the percent symbols to locate
Apple Computer directory. Delete the backup. Then backup your device to iTunes. Transfer purchases and use encryption. Before that you will see on the main device summary page "This device has never been backed up to this computer."
Make sure you write down your password. I remembered my password for two of my devices. Then for one other device I could not remember the password. I will defiantly write down all passwords now.
Using encryption will transfer all data within the applications.
Well....I have no idea why the us remembered password is still required. I should have been able to set a new password since this is actually like a new back up.
I was replying to OP's questions which, from what I can see, isn't related to your post. I also see that you created a separate thread with your iTunes encrypted backup issue. Please keep your discussion confined to that thread so we can keep this discussion on topic.