|
| 1 | +.. _php-upgrade: |
| 2 | + |
| 3 | +======================= |
| 4 | +Upgrade Driver Versions |
| 5 | +======================= |
| 6 | + |
| 7 | +.. contents:: On this page |
| 8 | + :local: |
| 9 | + :backlinks: none |
| 10 | + :depth: 1 |
| 11 | + :class: singlecol |
| 12 | + |
| 13 | +.. facet:: |
| 14 | + :name: genre |
| 15 | + :values: reference |
| 16 | + |
| 17 | +.. meta:: |
| 18 | + :keywords: compatibility, backwards compatibility |
| 19 | + |
| 20 | +Overview |
| 21 | +-------- |
| 22 | + |
| 23 | +On this page, you can learn how to upgrade your driver to a new version. This |
| 24 | +page also includes the changes you must make to your application when you |
| 25 | +upgrade to a new version of the {+php-library+}. |
| 26 | + |
| 27 | +How to Upgrade |
| 28 | +-------------- |
| 29 | + |
| 30 | +Before you upgrade, perform the following actions: |
| 31 | + |
| 32 | +- Ensure the new {+driver-short+} version is compatible with the {+mdb-server+} versions |
| 33 | + your application connects to and the PHP version your |
| 34 | + application compiles with. For version compatibility information, see the |
| 35 | + :ref:`{+php-library+} Compatibility <php-compatibility>` |
| 36 | + page. |
| 37 | +- Address any breaking changes between the driver version |
| 38 | + your application is using and your planned upgrade version in the |
| 39 | + :ref:`Breaking Changes <php-breaking-changes>` section. |
| 40 | + |
| 41 | +.. tip:: |
| 42 | + |
| 43 | + To ensure compatibility across {+mdb-server+} versions when |
| 44 | + upgrading driver versions, use the :ref:`{+stable-api+} <php-stable-api>`. |
| 45 | + |
| 46 | +Major and minor versions of the PHP extension and library are in sync. This |
| 47 | +means you can run an upgrade command for the extension to also upgrade the PHP |
| 48 | +library. |
| 49 | + |
| 50 | +Patch versions (x.x.x) for the library and extension are not in sync. Run the |
| 51 | +respective commands to update to the patch versions for the library or extension. |
| 52 | + |
| 53 | +To upgrade the PHP extension, replace ``<version-number>`` with the version number |
| 54 | +you want to upgrade to and run the following command in your application's |
| 55 | +directory: |
| 56 | + |
| 57 | +.. code-block:: bash |
| 58 | + |
| 59 | + pecl upgrade mongodb-<version-number> |
| 60 | + |
| 61 | +To upgrade the PHP library version, replace ``<version-number>`` with the |
| 62 | +version number you want to upgrade to and run the following command in your |
| 63 | +application's directory: |
| 64 | + |
| 65 | +.. code-block:: bash |
| 66 | + |
| 67 | + composer require mongodb/mongodb:<version-number> |
| 68 | + |
| 69 | +Detailed installation instructions may be found in the |
| 70 | +:php:`PHP.net documentation <manual/en/mongodb.installation.php>`. |
| 71 | + |
| 72 | +.. _php-breaking-changes: |
| 73 | + |
| 74 | +Breaking Changes |
| 75 | +---------------- |
| 76 | + |
| 77 | +A breaking change is a change of a convention or a behavior starting in a specific |
| 78 | +version of the driver. This type of change may prevent your application from working |
| 79 | +properly if not addressed before upgrading the driver. |
| 80 | + |
| 81 | +The breaking changes in this section are categorized by the driver version that introduced |
| 82 | +them. When upgrading driver versions, address all the breaking changes between the current |
| 83 | +and upgrade versions. |
| 84 | + |
| 85 | +For more information on release changes, see the release notes and associated |
| 86 | +JIRA tickets for each release on `GitHub <https://github.com/mongodb/mongo-php-library/releases>`__. |
| 87 | + |
| 88 | +Version 1.20 Breaking Changes |
| 89 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 90 | + |
| 91 | +This driver version introduces the following breaking changes: |
| 92 | + |
| 93 | +- Drops support for {+mdb-server+} 3.6. |
| 94 | + |
| 95 | +Version 1.19 and Earlier |
| 96 | +~~~~~~~~~~~~~~~~~~~~~~~~ |
| 97 | + |
| 98 | +For driver versions 1.19 and earlier, see the release notes and associated |
| 99 | +JIRA tickets for each release on `GitHub <https://github.com/mongodb/mongo-php-library/releases>`__. |
0 commit comments