If you're the owner of the code, all the past versions of the project are and will be AGPL forever (or MIT, or BSD) but all the new versions will be whatever you want. You can also dual license. If someone forks the old AGPL version (or MIT, or BSD) they can keep that license on the fork, but they can't use your new code.