I have this issue with licensing.
I downloaded a third-party class from GitHub and it’s under the GPL v3 license. However, I used this class on another open-source project which is under the GPL v2 license, and submitting my script there, requires that everything is under GPL v2 from my side too.
Am I allowed to change the license for that class, even though I am not the author?
1
From the Free Software Fundation:
When we say that GPLv2 and GPLv3 are incompatible, it means there is
no legal way to combine code under GPLv2 with code under GPLv3 in a
single program. This is because both GPLv2 and GPLv3 are copyleft
licenses: each of them says, “If you include code under this license
in a larger program, the larger program must be under this license
too.” There is no way to make them compatible. We could add a
GPLv2-compatibility clause to GPLv3, but it wouldn’t do the job,
because GPLv2 would need a similar clause.
There is no way you can use GPLv2 and GPLv3 code in the same program and/or upgrade the licence.
5
No, you are not.
As a rule of thumb, only the copyright holder (i.e., the author of your third-party library) is allowed to change the license under which code is distributed.
There is a weird exception in the GPL, but it doesn’t help you: the FSF has historically encouraged that software be licensed under the GPLv2 or later. Specifically, in most cases, you will find the following in the LICENSE
file or equivalent:
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This means that GPLv2 code can be used in a GPLv3 project without incident.
Unfortunately, there is no clause, either in the GPLv2 or GPLv3, for using an earlier version of the GPL. You’ll either need to convince the GPLv2 project to upgrade to GPLv3 or avoid the GPLv3 library.
1
on another open-source project which is under the GPL v2 license,
Many GPL v2 projects do not limit their license version to 2.0 only but allow any later version. Some even allow earlier ones (if no license version is specified with the software itself).
So you should double-check if that open source project really requires 2.0 only or if it is possible to add under the current version and allow the project to upgrade smoothly. You should add that open source project to your question to make it more exemplary (also the other one you want to take from).
Am I allowed to change the license for that class, even though I am not the author?
No. However what I wrote above for GPL v2 counts as well for GPL v3: If with that code no specific version has been named, you’re allowed to use under any GPL version you wish, which would include GPL v2 then (note: then meaning if the needed pre-conditions are met).
I’m not a lawyer, but what I would do is read the license agreement of the GPLv2 work carefully. It may allow you to release your derived work under the GPLv2 or later. In that case, you can just release your combination as GPLv3.
It’s very unlikely that you can take GPLv3 code and release it as GPLv2, so you’d have to ask the original author for permission.
Likely you can’t do what you’re trying to do.
Make sure you check exactly what the license on the GPLv2 software says. Many projects use the copyright notice from the FSF verbatim which includes this clause:
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
If it does include this clause, then you can use both products under GPLv3. Some projects, notably the Linux kernel, do not include this clause. If this project doesn’t include this clause, you are out of luck. The two versions of the license are not compatible without the “or any later version” clause and only the copyright holder can change the license.
If it does include this clause, you don’t have to change either of the licenses, since GPLv2 with the “or any later version” clause is compatible with GPLv3.