--- title: Migration from BT.CPP 3.x description: How to migrate your code from version 3.8 hide_table_of_contents: false sidebar_position: 7 --- # Migrating from version 3.8 to 4.X You will find that most of the changes in version 4.X are incremental and back compatible with your previous code. Here we try to summarize the most relevant difference that you should be aware of, when migrating. :::note In the repository you can find a Python script called **convert_v3_to_v4.py** that may save you some time (thanks to user https://github.com/SubaruArai)! Try it, but make sure that you double-check the result first! ::: ## Class renaming The names of the following classes / XML tags changed. | Name in 3.8+ | Name in 4.x | Where | |-------------|---------|---------| | NodeConfiguration | NodeConfig | C++ | | SequenceStar | SequenceWithMemory | C++ and XML | | AsyncActionNode | ThreadedAction | C++ | | Optional | Expected | C++ | If you want to quickly fix the compilation of your C++ code (**even if refactoring is encouraged**) add: ```cpp namespace BT { using NodeConfiguration = NodeConfig; using AsyncActionNode = ThreadedAction; using Optional = Expected; } ``` ## XML You should add the attribute `BTCPP_format` to the \ tag of your XML: Before: ```xml ``` Now: ```xml ``` This will allow us to be compatible with both versions 3 and 4... eventually! ## SubTree and SubTreePlus The default **SubTree** in 3.X has been deprecated in favor of **SubtreePlus**. Being this the new default, we simply call it "SubTree". | Name in 3.8+ | Name in 4.x | |-------------|---------| | `` | Deprecated | | `` | `` | ## SetBlackboard and BlackboardCheck The new [scripting language](/docs/guides/scripting) is much simpler and more powerful. Check also the introduction to [Pre and Post Conditions](/docs/guides/pre_post_conditions). Old code in **3.8**: ``` xml ``` New code in **4.X**: ``` xml