Short answer. No, generally not. Article 2257 says a civil sanction or penalty the Code attaches to acts not penalized under the former laws does not apply to someone who did that act while the old laws were in force. If the old law also punished it, the less severe sanction applies instead.
What the law says
Provisions of this Code which attach a civil sanction or penalty or a deprivation of rights to acts or omissions which were not penalized by the former laws, are not applicable to those who, when said laws were in force, may have executed the act or incurred in the omission forbidden or condemned by this Code.
Civil Code, Article 2257 — Sanctions Not Applied Retroactively. Read the full provision →
What the law says
If the fault is also punished by the previous legislation, the less severe sanction shall be applied.
Civil Code, Article 2257 — Sanctions Not Applied Retroactively. Read the full provision →
A brand-new penalty does not reach back to your past act
Article 2257 answers your question directly. It provides that Code provisions "which attach a civil sanction or penalty or a deprivation of rights to acts or omissions which were not penalized by the former laws, are not applicable to those who, when said laws were in force, may have executed the act or incurred in the omission forbidden or condemned by this Code." If what you did was not penalized at all under the law in force at the time, the new Code's penalty for that same conduct cannot be applied to you retroactively.
If the old law already punished it, the milder sanction wins
Your situation is different if the former law also penalized the same conduct, just with a different sanction. The article handles that scenario too: "if the fault is also punished by the previous legislation, the less severe sanction shall be applied." So where both the old law and the new Code attach some penalty to the same act, you benefit from whichever sanction is actually milder, rather than automatically facing the new Code's penalty just because it happens to be in effect now.
Why the law works this way
This approach protects people from being penalized under standards that did not exist when they acted, respecting the basic fairness principle that a person should be able to know, at the time they act, what consequences the law attaches to that conduct. Applying a brand-new penalty retroactively to conduct nobody could have known would be sanctioned at the time would punish people for failing to predict a law that had not yet been written.
An important limit: ongoing or repeated conduct is treated differently
This protection is specifically about acts or omissions that were already completed under the old law. A continuous or repeated act that began before the new Code took effect but continues or is repeated afterward is treated differently, since the conduct is, in that sense, still ongoing under the new Code's regime. If your situation involves a single, completed past act rather than something ongoing, the protection described above is what applies to you.