|
| 1 | +--- |
| 2 | +myst: |
| 3 | + html_meta: |
| 4 | + description: Learn how to enable and use Hypernode Object Storage Versioning |
| 5 | + title: Hypernode Object Storage | Object Versioning |
| 6 | +--- |
| 7 | + |
| 8 | +# Object Versioning |
| 9 | + |
| 10 | +With object versioning, you can keep track of changes made to your objects in the Object Storage workspace. This allows you to restore previous versions of your objects when needed. |
| 11 | + |
| 12 | +## Enabling Object Versioning |
| 13 | + |
| 14 | +To enable object versioning, you can use the `update` command with the `--enable-versioning` flag. This will enable versioning for all objects in your Object Storage workspace. |
| 15 | + |
| 16 | + |
| 17 | +```console |
| 18 | +app@abcdef-example-magweb-cmbl:~$ hypernode-object-storage update --enable-versioning |
| 19 | +Enabling versioning... |
| 20 | +``` |
| 21 | + |
| 22 | +It's also possible to enable versioning in the Control Panel. To do this, go to the Object Storage workspace you want to enable versioning for, and flip the Object Versioning toggle. |
| 23 | + |
| 24 | +```{note} |
| 25 | +Object versioning increases the storage space used by your objects. Each version of an object is stored separately, so if you have a lot of changes to your objects, you may need a bigger storage plan at some point. |
| 26 | +``` |
| 27 | + |
| 28 | +## Restoring object revisions |
| 29 | + |
| 30 | +With the `restore` command, you can restore an object to the state it was in at a specific point in time. You can specify the date and time of the revision you want to restore, as well as the object path. |
| 31 | + |
| 32 | +The date and time should be in the format `YYYY-MM-DD HH:MM:SS`. The object path can be the full path to the object you want to restore or a path to a directory. If you specify a directory, all objects in that directory will be restored to the specified revision. |
| 33 | + |
| 34 | +```console |
| 35 | +app@abcdef-example-magweb-cmbl:~$ hypernode-object-storage restore main "2025-04-24 06:00:00" media/catalog/product/e/x/example.jpg |
| 36 | +``` |
| 37 | + |
| 38 | +By default, the `restore` command will only show what it would do without actually restoring the objects. To actually restore the objects, you need to add the `--apply` flag. |
| 39 | + |
| 40 | +```{note} |
| 41 | +The `restore` command restores objects in place. This means that the current version of the object will be replaced with the version you are restoring. If you want to keep the current version of the object (or directory), you should make a copy of it before running the `restore` command. |
| 42 | +``` |
| 43 | + |
| 44 | +## Interactively exploring revisions |
| 45 | + |
| 46 | +You can also explore your objects and their revisions interactively using the `explore` subcommand. This will open a terminal UI file browser where you can navigate through your objects and their versions. |
| 47 | + |
| 48 | +```console |
| 49 | +app@abcdef-example-magweb-cmbl:~$ hypernode-object-storage explore |
| 50 | +``` |
| 51 | + |
| 52 | +Here's an example of how the terminal UI looks when you run the `explore` command: |
| 53 | + |
| 54 | + |
0 commit comments