Upgrade compiler and runtime lib from proto2 to proto3 but stay file syntax version on 2
229 views
Skip to first unread message
Jiang Cao
unread,
Feb 1, 2023, 7:02:20 AM2/1/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Protocol Buffers
We had persistent some data using proto2, we plan upgrade the compiler and runtime library to proto3 but keep the proto file syntax on 2. Is it a safe upgrade operation? Is there any risk reading the old binary data? Is it officially supported by protobuf project? I don't see any doc describing it.
sh...@google.com
unread,
Feb 2, 2023, 2:33:32 PM2/2/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Protocol Buffers
I don't think we have separate compiler and runtime versions for proto2 and proto3, unless you meant that proto2 is protobuf 2.x release and proto3 is protobuf 3.x release. In that case, there might be minor breaking changes for the version upgrades you'll need to pay attention. Actually, I recommend you make an upgrade since 2.x release is about nine years ago.
Jiang Cao
unread,
Feb 5, 2023, 9:11:10 PM2/5/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Protocol Buffers
Thanks for your help with this issue! Yes, I mean protobuf 2.x and protobuf 3.x release. We have lots of binary data persistent by protobuf 2.x and syntax v2. Now we want upgrade to protobuf 3.x and keep using syntax v2, but we have concern on the existing data. Will protobuf 3.x be compatible with protobuf 2.x binary data? Is it officially supported by protobuf project?
Dr. Holley
unread,
Mar 15, 2023, 4:32:34 AM3/15/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Protocol Buffers
Compiled files produced by protoc executable aren't binary files. They are just plain serializable data structures, not objects, to be usable in the accepted programming language of your choice. Protobuf is designed to be backward compatible, so you can rest assure on that outdated version support.